lesomuzik
New user

Posts: 2
|
Hello, I'm trying to load special characters (special letters for Central European contries like č,ď,ň,ľ etc.) from .txt file in resources. In WTK emulator I get nice characters, but in my phones (Nokia 3120, Sony Ericsson k530i) I get different characters. I tried
InputStream is = getClass( ).getResourceAsStream(filePath); InputStreamReader r; = new InputStreamReader(is);
while ((count = r.read(buffer, 0, buffer.length)) > -1) { sb.append(buffer, 0, count); } str = sb.toString();
As I said, works great in WTK, but in phones doesn't work. Note, that my phones can write these characters, but they are not able to read them from file.
Later I tried InputStreamReader.read:int and I found, that those special characters are coded in 2 bytes. WTK reads these 2 bytes together(as 1 int, value is over 256), but phones read them seperately and I get 2 bytes (value < 256) instead of one int.
Thanks for all ideas 
|