TDPL reaches Thermopylae level

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Oct 30 07:25:27 PDT 2009


Lars T. Kyllingstad wrote:
> Nick Sabalausky wrote:
>> "Chris Nicholson-Sauls" <ibisbasenji at gmail.com> wrote in message 
>> news:hcctuf$140a$1 at digitalmars.com...
>>> Granted LTR is common enough to be expectable and acceptable.  To be 
>>> perfectly honest, I don't believe I have *ever* even used 
>>> wchar/wstring. Char/string gosh yes; dchar/dstring quite a bit as 
>>> well, where I need the simplicity; but I've yet to feel much need for 
>>> the "weirdo" middle child of UTF.
>>>
>>
>> Given that just about anything outside of D (at least as far as I've 
>> seen) that attempts to use unicode does so with UTF-16 (or just uses 
>> UCS-2 and pretends that's UTF-16...), wchar and wstring are great for 
>> dealing with that. For instance, my Goldie engine for GOLD currently 
>> uses wchar in a number of places because GOLD's .cfg format stores 
>> text in...well, presumably UTF-16 (I haven't tested to see if it's 
>> really UCS-2). But yea, as long as you're not dealing with anything 
>> that's already in UTF-16 or that expects it, then it does seem to be 
>> somewhat questionable. 
> 
> I think this says it all:
> 
> http://en.wikipedia.org/wiki/Utf-16#Use_in_major_operating_systems_and_environments 
> 
> 
> -Lars :)

Yep, there was a frenzy when UCS-2 came about: everybody thought two 
bytes will be enough for everyone. So UCS-2 was widely adopted - who 
wouldn't love to have constant character width? Then, the UTF-16 
surrogate business came about, and the only logical step they could take 
was to migrate to UTF-16, which was upward compatible to UCS-2. I 
personally think UTF-8 is a better overall design though.

Andrei



More information about the Digitalmars-d mailing list