How to ensure string compatibility In D?

Olivier Pisano olivier.pisano at laposte.net
Tue Jan 22 14:07:48 UTC 2019


On Tuesday, 22 January 2019 at 13:55:30 UTC, FrankLike wrote:
> Hi,everyone,
>   In C++, _T can guarantee that when converting from ascii 
> encoding type to unicode encoding type, the program does not 
> need to be modified. What do I need to do in D?
>
> Thanks.

Hi,

_T is not relevant to C++, but to Windows programming.

In D, there is only Unicode. The language doesn't manipulate 
strings encoded in Windows local code-pages.

char means UTF-8 (Unicode encoded in 8bit units).
wchar means UTF-16 (Unicode encoded in 16bit units, what Windows 
documentation calls "Unicode").
dchar means UTF-32 (Unicode encoded in 32bit units).

When manipulating data encoded in Windows local code page, use 
the ubyte[] type.


More information about the Digitalmars-d-learn mailing list