I'm trying to read some text from an html file, modify it in a specific way and write the result in a new html file. But the problem is that the text is not written in English and as a result some characters are replaced with black and white "?" marks. In my html file, I have < meta http-equiv="Content-Type" content="text/html; charset=utf-8">. What am I doing wrong? Maybe not the right Readers and Writers?
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new FileReader("inputFile.html"));
String line;
while ( (line = br.readLine()) != null) {
sb.append(line);
}
String result = doSomeChanges(sb);
BufferedWriter out = new BufferedWriter(new FileWriter("outputFile.html"));
out.write(result);
out.close();