Answer the question
In order to leave comments, you need to log in
How to write a Russian string in UTF-8 and/or cp1251 to a file?
The Russian string that needs to be written to the file is stored directly in the code: String someValue = "Поехали!";
I tried to write to the file like this:
BufferedWriter bw = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(targetFilePath))
);
bw.write(someValue + "\n");
bw.close();
The result in notepad (notepad.exe) is:???????!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question