contrary of std.utf.toUTFz!(const(wchar)*)

Christophe travert at phare.normalesup.org
Fri Oct 7 05:59:10 PDT 2011


Trass3r , dans le message (digitalmars.D.learn:29978), a écrit :
>> I feel a little stupid, but how to convert  a wchar* zero terminated  
>> string into a wstring (DMD 2.055)?
> 
> wstring w = cstr[0 .. strlenw(cstr)];

if cstr comes from c code, you cannot guarantee it is immutable.

Moreover, cstr might point to 0.



More information about the Digitalmars-d-learn mailing list