How to convert "string" to const(wchar)* ?

Ferhat Kurtulmuş aferust at gmail.com
Wed Jan 29 06:49:30 UTC 2020


On Wednesday, 29 January 2020 at 05:17:03 UTC, Marcone wrote:
> How to convert "string" to const(wchar)* ?
> The code bellow is making confuse strange characters.
>
> cast(wchar*) str

this seems working:

string s = "test ğüişçöıı";
wstring wstr = s.to!wstring;

const(wchar)* str = wstr.ptr;
writeln(str[0..wstr.length]); // do not try to print pointer 
const(wchar)*
                               // use slicing


More information about the Digitalmars-d-learn mailing list