Fractal

Robert Fraser fraserofthenight at gmail.com
Mon Jun 8 17:52:59 PDT 2009


Frits van Bommel wrote:
> Fractal wrote:
>> Jarrett Billingsley Wrote:
>>> Because those are the three string encodings D supports, and only
>>> supporting one is a dumb idea.
>>
>> Why? wchar is full compatible with all languages (if it is not please 
>> tell me)... also when I have many strings in different types, I need 
>> to convert it from one type to other in each part of the program. Why 
>> three when one is suffice?
> 
> IIRC, Chinese characters can't be represented by a single wchar. 
> However, that's not a problem since all three string types support full 
> Unicode.
> 
>>> are all Unicode, just different encodings.  However, even if you can
>>> throw an exception in Spanish, it might not print out correctly on
>>> Windows unless you have your console configured correctly.
>>
>> Oh... I will take a look for that (console configuration)... but the 
>> char type dont supports some languages, because it only supports 
>> latin... Im wrong? The Exception on the two APIs uses char[]. I want 
>> Inernationalized programs.
> 
> char[] supports any language that wchar[] and dchar[] support. It's just 
> that with char and wchar you need more than one of them for some 
> characters.
> 
> You may want to read 
> http://prowiki.org/wiki4d/wiki.cgi?DanielKeep/TextInD and 
> http://en.wikipedia.org/wiki/Unicode (or one of its many translations if 
> your English is not so good).

I'd recommend using char[] for everything (unless you're calling Windows 
API functions, then wchar[] is better). All three can support all 
characters, so just pick one and roll with it.



More information about the Digitalmars-d mailing list