My J2ME application has to read files in different languages (English, French, Arabic).
The files are written with UTF-8 encoding, and I read them with this code:
InputStream is = this.getClass().getResourceAsStream("/res/traduct_"+ lang +".txt");
StringBuffer sb = new StringBuffer();
int chars;
while ((chars = is.read()) != -1)
sb.append((char) chars);
String str = new String(String.valueOf(sb).getBytes("ISO-8859-1"));
This works fine in Netbeans emulator and also in my LG phone, but in other phones (Nokia, Samsung), Arabic and French are not displayed. Only English works in all cases.
Is there something wrong with my code?