<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - pdfunite introduces syntax error / illegal characters (as per pdfinfo)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103873#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - pdfunite introduces syntax error / illegal characters (as per pdfinfo)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103873">bug 103873</a>
              from <span class="vcard"><a class="email" href="mailto:tom.ty89@gmail.com" title="Tom Yan <tom.ty89@gmail.com>"> <span class="fn">Tom Yan</span></a>
</span></b>
        <pre>(In reply to Fredrik Fornwall from <a href="show_bug.cgi?id=103873#c6">comment #6</a>)
<span class="quote">> From <a href="https://github.com/termux/termux-packages/issues/1900">https://github.com/termux/termux-packages/issues/1900</a>:

> "prior to Android P (i.e. AOSP master), Android's printf didn't accept
> invalid UTF8 sequences in the format string, and so can't be used to print
> arbitrary bytes like this. you'd need to use %c%c%c%c -- as your other
> example does -- or (hilariously) %s (because only the format string is
> checked). this is from BSD code, so it's not just Android that has/had this
> limitation, so you may be able to get upstream to switch to the same
> %c%c%c%c workaround as your other example."

> Would the above patch work for you?</span >

Yup I am on Android N and can confirm that the \x is the problem:

$ cat test.c
#include <stdio.h>
int main() {
  printf("%%\xE2\xE3\xCF\xD3\n");
  printf("%%%s\n", "\xE2\xE3\xCF\xD3");
  printf("%%%c%c%c%c\n", 0xe2, 0xe3, 0xcf, 0xd3);
}
$ clang test.c
$ ./a.out
%%����
%����
$ ./arch/startarch
[21:37 home ]$ clang test.c
[21:38 home ]$ ./a.out
%����
%����
%����

And pdfinfo no longer complains about any file produced by pdfunite in poppler
0.61.1-2 on Termux (which has the patch applied).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>