toString vs. toUtf8

Sean Kelly sean at f4.ca
Mon Nov 19 16:28:03 PST 2007


Walter Bright wrote:
> Phobos (and D) has undergone some evolution in the thinking about 
> unicode strings, and it certainly has a few anachronisms in its names. 
> But I think we've evolved to the point where going forward, we know what 
> to do:
> 
> char[] => string
> wchar[] => wstring
> dchar[] => dstring
> 
> These are all unicode strings. Putting non-unicode encodings in them, 
> even temporarily, should be discouraged. Non-unicode encodings should 
> use ubyte[], ushort[], etc.

This seems fair.  It would reinforce the idea that strings really do use 
a common encoding format, and that foreign encodings are relegated to a 
different form of transport.  Now if only toWString didn't look so 
horrible :-)


Sean



More information about the Digitalmars-d mailing list