dchar, wchar, char conversions: what is the best practice?

torhu fake at address.dude
Sat Feb 3 02:27:55 PST 2007


Kevin Bealer wrote:
> What is the 'best practice' when converting from dchar to char or vice 
> versa?  And wchar of course.
> 
> I expected this code to do a magic conversion:
> 
> dchar[] one = "one";
> char[] one_a = cast(char[]) one;


import std.utf;
char[] one_a = toUTF8(one);

There's also toUTF16 and toUTF32.


More information about the Digitalmars-d-learn mailing list