I'm currently reading UTF-8 encoded data from a file like this:
This works fine for most special characters, but two characters ('ā' and 'š') do not seem to be recognized (all other special characters from my language are recognized properly: ēŗūīōģļķžčņ ). When I output the strings in GUI, these two characters are output as a square and a '?' (each character as a combination of both of these).
If I pass the same characters as literals, they are displayed properly.
All files (including the source with literals and the file being read) are encoded in UTF-8 and edited using Notepad2 (not a typo - there is a program called Notepad2).
The code is compiled using the -encoding UTF-8 parameter.
So - how do I get proper UTF-8 from a file all the way to GUI?
Code:
BufferedReader input = new BufferedReader(new FileReader(new File(System.getProperty("java.library.path")+"\\"+_file)));
String curline = new String(input.readLine().getBytes(),"UTF-8");
If I pass the same characters as literals, they are displayed properly.
All files (including the source with literals and the file being read) are encoded in UTF-8 and edited using Notepad2 (not a typo - there is a program called Notepad2).
The code is compiled using the -encoding UTF-8 parameter.
So - how do I get proper UTF-8 from a file all the way to GUI?
Comment