First Impressions

Anders F Björklund afb at algonet.se
Sun Oct 1 13:43:32 PDT 2006


BCS wrote:

> One alternative that I could live with would use 4 character types:
> 
> char    one codeunit in whatever encoding the runtime uses
> schar    one 8 bit code unit (ASCII or utf-8)
> wchar    one 16 bit code unit (same as before)
> dchar    one 32 bit code unit (same as before)

We have that already:

ubyte   one codeunit in whatever encoding the runtime uses
char    one 8 bit code unit (ASCII or utf-8)

There is no support in Phobos for runtime/native encodings,
but you can use the "iconv" library to do such conversions ?

> (using the same thing for ASCII and UTF-8 may be a problem, but this isn't my field)

All ASCII characters are valid UTF-8 code units, so it's OK.

--anders



More information about the Digitalmars-d mailing list