TDPL: Foreach over Unicode string

Sean Kelly sean at invisibleduck.org
Fri Jul 30 08:09:55 PDT 2010


Walter Bright <newshound2 at digitalmars.com> wrote:
> Kagamin wrote:
>> Walter Bright Wrote:
>>>> When writing characters out to Windows, though, you have to be
> > > > careful what >> "code page" Windows thinks your app is running
> > > > in.
>>> It's valid for char functions.
>> Is it valid that wide functions don't work either?
> 
> The wide functions are supposed to be utf16, and those should work.

Surprisingly, they don't appear to work properly. The locale used for
the UTF16 to multibyte conversion is the currently set locale, and that
prints garbage on my Windows install. I had to use the OEM locale for it
to work. I was going to fix this but wasn't sure if std.stdio should be
setting the codepage it requires, or if the DMC code is broken (which
doesn't seem likely).


More information about the Digitalmars-d mailing list