Answer the question
In order to leave comments, you need to log in
Why is the Russian text distorted when reading from a JSON file?
Good afternoon.
When reading from a JSON file, the Russian text is distorted. And if you run the program from Intellij Idea, then everything is fine. If from the terminal on the Maven command line then the text is garbled.
I understand that somewhere there are problems with the encoding, but I have not yet found how to fix the solution.
Answer the question
In order to leave comments, you need to log in
Try setting the encoding when reading the file:
InputStreamReader in = new InputStreamReader(new FileInputStream(filePath), "UTF8"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question