Xavier Mor-Mur wrote:

> String usStr; (or UnicodeString usStr;)
> AnsiString asStr;
> 
> usStr = URLDEcode( "Sin%20t%C3%ADtulo%201_html_m5b7e3440.jpg" );
> asStr = usStr; <--- Compiler introduce required conversion code
> 
> using
>       asStr = UTF8Decode( usStr );
> or
>      asSTR = UTF8Decode( URLDEcode(
> "Sin%20t%C3%ADtulo%201_html_m5b7e3440.jpg" ) );

Conversion from Unicode to AnsiString might lead to dataloss, 
whether the source be UTF-8 or UTF-16. If you actually need a 
AnsiString with code page CP_UTF8 you should use type UTF8String
instead of AnsiString. 
Since 2009 the compiler is code page aware and implicitly 
converts between UTF8String and (Unicode)String without
dataloss and warnings. In this case one could also write a 
slighty different version of UrlDecode() that returned a 
UTF8String to save a few conversions.

--
Arno Garrels

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to