Following code works with file having English content perfectly but not with Russian content. How to make it work for Russian as well?
try(BufferedReader fileOut = new BufferedReader(new FileReader(file))){
for(String line; (line = fileOut.readLine()) != null; ){
if(line.contains(commandString))
System.out.println(count + ": " + line);
count++;
}
}
UPD:
I tried to write: this only works when the line contains one word then outputs, for example: "привет" If a line contains more than one word is no output, for example "привет как дела"
new BufferedReader(new InputStreamReader(new FileInputStream(file), "Cp1251"))
p.s: thank very much for answers