LPOLESTR* to string

John Colvin john.loughran.colvin at gmail.com
Tue Feb 11 04:36:03 PST 2014


On Monday, 10 February 2014 at 22:06:14 UTC, Jakob Ovrum wrote:
> On Monday, 10 February 2014 at 17:54:14 UTC, John Colvin wrote:
>> Or if you're sure you don't have any wide characters:
>>
>> auto rgszNamesStr = to!string(rgszNames[0][0 .. 
>> wcslen(rgszNames[0])]);
>
> to!string on a well-formed UTF-16 string is always safe. It 
> will transcode to UTF-8.

Awesome. Sorry for the misinformation, I don't really know a lot 
about phobos w.r.t. unicode. There was some talk of an article on 
it by someone, but I don't remember seeing it happen.


More information about the Digitalmars-d-learn mailing list