I read through zhaofei's posting regarding Chinese encoding on Nokia's Developer Discussion Board, and I must say that he'd done a terrific job! Such an altruistic deed is highly admirable.
Unfortunately, with my limited ken, I've encountered a problem that I don't know how to solve. That is the reason why I'm posting the question here, hoping any of you to give me sound advice.
I've listed down the steps I went through as follows:
1) Using UltraEdit, I created a text file and input some chinese characters.
2) The text file was converted from Unicode to UTF-8 by using the conversion option "Unicode/UTF-8 to UTF-8 (Unicode Encoding)" available in UltraEdit.
3) Then I tried to read the contents of the text file using the following code.
DataInputStream dataInputStream = new DataInputStream(getClass().getResourceAsStream("data.txt"));
String string = dataInputStream.readUTF();
4) Unfortunately, the readUTF() operation keeps throwing EOFException.
Do you know what is wrong here? I'd appreciate if you could enlighten.
Thanks a million.