Working with utf

Simen Haugen simen at norstat.no
Thu Jun 14 07:22:07 PDT 2007


I tested this now, and it works like a charm. This means I can finally get 
rid of all my convertions between utf8 and latin1! (together with all these 
hidden bugs)

Thanks a lot for all your help.

"Frits van Bommel" <fvbommel at REMwOVExCAPSs.nl> wrote in message 
news:f4rh01$lkt$2 at digitalmars.com...
> Except his input is encoded as Latin-1, not UTF-8. Conversion is still 
> trivial though:
> ---
> auto latin1 = cast(ubyte[]) std.file.read("some_latin-1_file.txt");
> dchar[] utf = new dchar[](latin1.length);
> for(size_t i = 0; i < latin1.length; i++) {
>     utf[i] = latin1[i];
> }
> ---
> and the other way around.
> (The first 256 code points of Unicode are identical to Latin-1) 





More information about the Digitalmars-d mailing list