I read some text from html website and need to store the data. I know the source encoding (iso-8859-1) and destination encoding(windows-874) from the website http://alexpad.com/textdecoder
The source text is "áÁèÃÔÁ" and I need to convert it to "แม่ริม" However the output is always be "??????" which are arrays of [63,63,63,63,63,63]
string text = "áÁèÃÔÁ";
Encoding fromEncoding = Encoding.GetEncoding("iso-8859-1");
Encoding toEncoding = Encoding.GetEncoding("windows-874");
byte[] fromBytes = fromEncoding.GetBytes(text);
byte[] toBytes = Encoding.Convert(fromEncoding, toEncoding, fromBytes);
string result = toEncoding.GetString(toBytes);
expected result is "แม่ริม" actual results is "??????" which is wrong