F
Francois
I read a file encode as utf8, and it has accented characters displayed
as Rémi (in gvim).
I read and parse the file
File xmlFile is the file handler.
using:
InputStreamReader in = new InputStreamReader(new FileInputStream
(xmlFile), "UTF-8");
filter.parse(new InputSource(new BufferedReader(in)));
When the parsing is done, I output the file with
Writer out = new OutputStreamWriter(new FileOutputStream(outfile),
"UTF-8");
filter.setContentHandler(new XMLWriter(out));
During the parsing, I substitute the attributes content using a
HashMap wich is read from another file with
FileInputStream r = new FileInputStream(d);
InputStreamReader is = new InputStreamReader(r);
System.out.println("Zmodif encoding " + is.getEncoding());
BufferedReader reader = new BufferedReader(is);
String line;
while ((line = reader.readLine())!= null){
byte[] conv = line.getBytes("ISO-8859-1");
String u8Line = new String(conv, "UTF8");
...
I put u8line in the HashMap and it to make the substitutions
}
My problem is that that output file has accented characters like this
Rémi instead of Rémi
I don't know where it comes from and how to change it ...
Thanks for any help
Francois
as Rémi (in gvim).
I read and parse the file
File xmlFile is the file handler.
using:
InputStreamReader in = new InputStreamReader(new FileInputStream
(xmlFile), "UTF-8");
filter.parse(new InputSource(new BufferedReader(in)));
When the parsing is done, I output the file with
Writer out = new OutputStreamWriter(new FileOutputStream(outfile),
"UTF-8");
filter.setContentHandler(new XMLWriter(out));
During the parsing, I substitute the attributes content using a
HashMap wich is read from another file with
FileInputStream r = new FileInputStream(d);
InputStreamReader is = new InputStreamReader(r);
System.out.println("Zmodif encoding " + is.getEncoding());
BufferedReader reader = new BufferedReader(is);
String line;
while ((line = reader.readLine())!= null){
byte[] conv = line.getBytes("ISO-8859-1");
String u8Line = new String(conv, "UTF8");
...
I put u8line in the HashMap and it to make the substitutions
}
My problem is that that output file has accented characters like this
Rémi instead of Rémi
I don't know where it comes from and how to change it ...
Thanks for any help
Francois