title: (Android NDK) Strings containing non-ASCII characters get cut off
body: <p>I'm trying to port a program written in C to Android using the NDK and JNI, and I'm stuck with a ridiculous problem which is driving me crazy.</p>
  
  <p>To make it short, if I do this...</p>
  
  <pre><code>char str[1024];
  sprintf(str, "Hellö, this is söme stränge letters.");
  </code></pre>
  
  <p>...<em>strlen(str)</em> returns 35, as expected. Right?</p>
  
  <p>But if I include a specifier, and do this...</p>
  
  <pre><code>char str[1024];
  sprintf(str, "Hellö again. Here's a number: %d", 1);
  </code></pre>
  
  <p>...<em>strlen(str)</em> returns 4.</p>
  
  <p>Do you see what's happening? It appears the NDK can't (or won't?) accept non-ASCII characters in strings, if I try to format them.</p>
  
  <p>Any time I include an ASCII character >127 in the format string, it just gets cut off. Like it was NULL-terminated.</p>
  
  <p>Is this a bug? Is this expected behaviour?</p>
  
  <p>Ultimately, my question is: <strong>What can I do to solve this?</strong></p>
  
  <p>Many thanks in advance.</p>