Answer the question
In order to leave comments, you need to log in
How to read *.properties files with Russian text in Java?
The files contain the text:
file=Файл
view=Вид
project=Проект
help=Справка
properties = new Properties();
InputStream inputStream = MainMenu.class.getClassLoader().getResourceAsStream("file.properties");
try {
properties.load(inputStream);
} catch (IOException e) {
e.printStackTrace();
}
����
Answer the question
In order to leave comments, you need to log in
The properties files must be in ISO-8859-1 encoding. Characters of other encodings must be escaped (\uXXXX). Use the native2ascii utility to convert. Better yet, use an IDE. They automatically escape characters.
I figured it out, IDEA itself converts files into a readable form for both the developer and the compiler
And where (in which folder) should I put the file that needs to be read?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question