<br><br><div class="gmail_quote">On Wed, Jul 28, 2010 at 12:34 AM, Sean Kelly <span dir="ltr"><<a href="mailto:sean@invisibleduck.org">sean@invisibleduck.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Sean Kelly Wrote:<br>
><br>
> I think it's Windows integration that's the problem, on OSX I get:<br>
><br>
> [H][a][l][l][?][?][,][ ][V][?][?][r][l][d][!]<br>
</div>> [H][a][l][l][å][,][ ][V][ä][r][l][d][!]<br>
<div class="im">><br>
> which is essentially correct. The only difference between this and doing the same thing in C and using printf() in place of write() is that both lines display correctly in C. I think printf() must be detecting partial UTF-8 characters and buffering until the complete chunk has arrived. Interestingly, the C output can't even be broken by badly timed calls to fflush(), so the buffering is happening at a fairly high level. I'd be interested in seeing the same thing in write() at some point.<br>
<br>
</div>Ah, write() already works that way. It was the brackets that were screwing things up.<br>
</blockquote></div><br>You are right about printf(), I'm getting the correct output with this code:<br><br>import std.stdio, std.stream;<br><br>void main() {<br> string str = "Hall\u00E5, V\u00E4rld!";<br>
foreach (dchar c; str) {<br> printf("%c", c);<br> }<br> writeln();<br>}<br><br>Hallå, Värld!<br><br>Should I file this as a Windows bug for DMD?<br>