title: sprintf() handling of %s extended ASCII (ISO 8859-1) on some runtimes?
body: <p>I'm using ISO 8859-1 (Latin extended ASCII char set) in my C application. When I <code>strcpy</code>/<code>strcat</code> the portions of the string together, it works fine. But when I use <code>sprintf("%s %s")</code>, on some runtimes (particularly certain versions of Android), the string will truncate when an extended ASCII character (specifically <code>é</code>, although I haven't tried others) is hit.</p>
  
  <p>I thought <code>%s</code> was just supposed to copy the bytes until <code>'\0'</code> was hit. I suspect that <code>strcpy</code>/<code>strcat</code> works because it does do just that, without any formatting. What could possibly be going on here?</p>
  
  <p>I should note that I'm not viewing the text using <code>printf()</code>, rather my own text rendering engine which handles ISO-8859-1 just fine.</p>
  
  <p>UPDATE:
  To clarify, I have an NDK app, which is keeping the string in C, and passing it to my OpenGL based text rendering engine. If I pass the full string as a char* literal, it displays fine. If I sprintf() the portions together, it gets truncated at the é character.
  For example:</p>
  
  <pre><code>char buffer[1024];
  strcpy(buffer, "This is ");
  strcat(buffer, "the string I want to diésplay.");
  </code></pre>
  
  <p>That shows up fine. But this:</p>
  
  <pre><code>sprintf(buffer, "%s%s", "This is ", "the string I want to diésplay.");
  </code></pre>
  
  <p>Prints as:</p>
  
  <pre><code>This is the string I want to di
  </code></pre>