I'm trying to write my own tools to help on translating HoMM online interface to english.
I'm writing my own classes to handle all this game related stuff. The problem comes when I need to handle chinese texts.
I need to read plain text from files in ANSI format, encoded with "GB18030" codepage (simplified chinese). I'm sure about the right codepage, as I can open these files with several programs (for example libre office calc) and get the correct chinese text if I select that codepage.
My code now is working on all implemented stuff, except I cannot read the right text if its chinese.
Strings text and filename are already declared, and filename (from openFileDialog1.FileName) works well, but the text is not correct, I get garbage instead of chinese text (numbers or english words are shown well).
Any suggestion?
EDIT: Solved.
The code was reading well, but I was showing in a textBox; now in a richTextBox it shows properly.
I'm writing my own classes to handle all this game related stuff. The problem comes when I need to handle chinese texts.
I need to read plain text from files in ANSI format, encoded with "GB18030" codepage (simplified chinese). I'm sure about the right codepage, as I can open these files with several programs (for example libre office calc) and get the correct chinese text if I select that codepage.
My code now is working on all implemented stuff, except I cannot read the right text if its chinese.
Code:
StreamReader sr = new StreamReader(filename, Encoding.GetEncoding("GB18030"), false);
text = sr.ReadToEnd();
Any suggestion?
EDIT: Solved.
The code was reading well, but I was showing in a textBox; now in a richTextBox it shows properly.