I am trying to translate strings into the Slovak alphabet (encoding 8859-2) through a comparable table I created. The problem is that some characters do not actually change, and the output line shows me "?" for some Slovak character.
How can I do it? At first I did something like this:
File tempFile = File.createTempFile("buffer", ".tmp");
FileWriter fw = new FileWriter(tempFile);
Reader fr = new FileReader(fileOriginal);
BufferedReader br = new BufferedReader(fr);
while (br.ready()) {
fw.write(br.readLine().replace("#/e#" , "ě").replace("#>E#" , "É")
}
but some characters are incorrectly replaced.
For example, in this line: "allo #> e # de #> E #" (just an example), he should give me "allo ě de É", but he gives me "allo? De?". because UTF-8 does not recognize these characters. What do I need to do so that my Java program recognizes it?
Thanks in advance.