i have a file that have some non-utf8 caracters (like \"ISO-8859-1\"), and so i want to convert that file (or read) to UTF8 encoding, how i can do it?
The code it\'s
String charset = "ISO-8859-1"; // or what corresponds
BufferedReader in = new BufferedReader(
new InputStreamReader (new FileInputStream(file), charset));
String line;
while( (line = in.readLine()) != null) {
....
}
There you have the text decoded. You can write it, by the simmetric Writer/OutputStream methods, with the encoding you prefer (eg UTF-8).