L
lbrtchx
I have some text data in a file I need to parse.
..
the file's data contains characters such as accents, ntildes, ...
..
if I go "cat file" I can see all characters fine in the source file,
but after I parse the data and save it in another file using:
..
// - - - - - - - - - - - - - - - - - - - - - - - - - -
String aEnc = "UTF-8";
// __
FileOutputStream FOStrm = new FileOutputStream((new File(aOFlNm)));
OutputStreamWriter OStrmRdr = new OutputStreamWriter(FOStrm, aEnc);
BffrWrtr = new BufferedWriter(OStrmRdr);
// __
FileInputStream FIStrm = new FileInputStream(Fl);
InputStreamReader IStrmRdr = new InputStreamReader(FIStrm, aEnc);
BffrRdr = new BufferedReader(IStrmRdr);
// __
aRdLn = BffrRdr.readLine();
while(aRdLn != null){
// . . .
aRdLn = BffrRdr.readLine();
}
// __
BffrWrtr.flush(); BffrWrtr.close();
BffrRdr.close();
// - - - - - - - - - - - - - - - - - - - - - - - - - -
..
I don't see the non-ASCII characters right in the file, but all kinds
of weird chars
..
How can I fix this problem?
..
thanks
lbrtchx
..
the file's data contains characters such as accents, ntildes, ...
..
if I go "cat file" I can see all characters fine in the source file,
but after I parse the data and save it in another file using:
..
// - - - - - - - - - - - - - - - - - - - - - - - - - -
String aEnc = "UTF-8";
// __
FileOutputStream FOStrm = new FileOutputStream((new File(aOFlNm)));
OutputStreamWriter OStrmRdr = new OutputStreamWriter(FOStrm, aEnc);
BffrWrtr = new BufferedWriter(OStrmRdr);
// __
FileInputStream FIStrm = new FileInputStream(Fl);
InputStreamReader IStrmRdr = new InputStreamReader(FIStrm, aEnc);
BffrRdr = new BufferedReader(IStrmRdr);
// __
aRdLn = BffrRdr.readLine();
while(aRdLn != null){
// . . .
aRdLn = BffrRdr.readLine();
}
// __
BffrWrtr.flush(); BffrWrtr.close();
BffrRdr.close();
// - - - - - - - - - - - - - - - - - - - - - - - - - -
..
I don't see the non-ASCII characters right in the file, but all kinds
of weird chars
..
How can I fix this problem?
..
thanks
lbrtchx