>>Thanks for the detailed answer. Maybe I was not precise enough in describing
>>the problem. My app (VB.NET/VS2010) uses external datasources (data from cd and a webservice)
>>which return string coded in (I believe) 1252. when I display or save these strings in my vb-programm
>>all special german or french characters (like öäü or ß) are lost. And i believe this happens because these
>>data is encoded on !251 and must betransformed to UTF?
>>
>>Best regards
>
>If you have a byte array from CP1252 try:
public static string Convert(Byte[] bytes)
> {
> Encoding cp1252 = Encoding.GetEncoding(1252);
> Encoding utf16 = Encoding.Unicode;
>
> Byte[] result = Encoding.Convert(cp1252, utf16, bytes);
> return Encoding.Unicode.GetString(result);
> }
or maybe just
return Encoding.GetEncoding(1252).GetString(bytes);
:=}