Need to do some "dirty" UTF-8 handling

Vladimir Panteleev vladimir at thecybershadow.net
Sun Jun 26 08:21:14 PDT 2011


On Sat, 25 Jun 2011 23:17:37 +0300, Nick Sabalausky <a at a.a> wrote:

> "Vladimir Panteleev" <vladimir at thecybershadow.net> wrote in message
> news:op.vxmuvzqbtuzx1w at cybershadow.mshome.net...
>>
>> string s;
>> foreach (dchar c; r)
>
> That doesn't throw on an invalid sequence?

You use rawToUTF8 to convert an arbitrary array of chars to valid UTF-8.  
You use UTF8ToRaw to convert the output of rawToUTF8 back to the original  
string.

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d-learn mailing list