3
Some strings are coming out like this when generating my . txt
É fácil entrar em contato com a área
I read another file. txt that has several sentences, I make a treatment of all the lines and separate the part that interests me, dai Gero a file . txt You’re getting off on this. has some way of solving?
Reader lerArquivo = new FileReader(getNomeArquivo());
BufferedReader br2 = new BufferedReader(lerArquivo);
String linha;
while ((linha = br2.readLine()) != null) {
}
//to generate the file I use
FileWriter x = new FileWriter("geraArquivo.txt", false);
x.write(organizaString);
It is very likely that you are reading files in a certain encoding and treating in another. For example, your file is UTF-8 and the platform is in another, as
FileReader
uses to the encoding of the platform gives problem. See if the read content also presents problem and if yes, try to useInputStream
to read. Also check which encoding your file and your platform, to see if they are not different.– Bruno César