I'm having trouble displaying chinese characters on the Nokia 3300 SDK beta_05 emulator, and the actual phone unit itself.
I was able to display the right characters, except that 2 BOXES appear in between 2 chinese characters... I used this code:
public class TextReader {
String str = "";
public TextReader(String url) {
StringBuffer buffer = new StringBuffer();
try {
InputStream is = this.getClass().getResourceAsStream(url);
InputStreamReader isr = new InputStreamReader(is, "UTF8");
int ch;
while ((ch = isr.read()) > -1) {
buffer.append((char)ch);
}
isr.close();
str = buffer.toString();
} catch (IOException e) {
e.printStackTrace();
}
}
public String getText() {
return str;
}
}
This code reads a file in "ANSI" format and displays the right chinese characters except for the fact that there appears 2 boxes in between characters.
Can anybody advise me on what steps to take to eliminate this problem? Also the problem with the actual unit... where the application displays boxes, instead of the correct Chinese characters...
Sorry, I do not understand Chinese... English replies are greatly appreciated. Thank you very much to all of you!
it worked well for me! i saved my text file as ANSI and the program automatically converts it to utf-8 when I read it... Problem solved now. thanks anyway!