4
I have a BD Paradox that returns me the following string after a query in a table of the sector that a certain worker is: Manutenþòo Elútrica. Actually it should be Electrical Maintenance. I need to return this string to a browser.
By my researches, this is a CP850 encoding that I need to convert to UTF-8, which is the encoding that is usually used. I saw this in the link:
Here’s what I’m trying to do on C#:
Encoding utf8 = Encoding.UTF8;
Encoding cp = Encoding.GetEncoding(850);
byte[] cpBytes = cp.GetBytes(identifColaborador.setor);//aqui já vem como ManutenþÒo ElÚtrica
byte[] utf8Bytes = Encoding.Convert(cp, utf8, cpBytes);
string msg = utf8.GetString(utf8Bytes);
But unfortunately I’m not succeeding. It still returns in the string msg Manutenþòo Elútrica
Where can I be missing?
Marcelo, thanks for the tip. I just needed to exchange Cp1252 for Windows-1252 and everything ran straight... Vlw
– Emerson