I have a message.properties file that contains Hebrew sentences like so:
loadData_fileStructureProblem=מבנה הקובץ אינו תקין
listViewer_notEnoughInformation=טיול זה לא מכיל מספיק מידע
Here is how I try to read from the file (an external function):
public static String getMessagesValue(Context context, String name, String defaults) {
Resources resources = context.getResources();
try {
InputStream rawResource = resources.openRawResource(R.raw.messages);
Properties properties = new Properties();
properties.load(rawResource);
return properties.getProperty(name);
It looks like it can find the right key-value pair but it returns a gibberish sentence like èéåì æä ìà îëéì îñôé÷ îéãò
instead of Hebrew.
What I've tried so far?
I saw that there is default encoding for .properties files in android studio.
The default in my program was windows-1255 so I've changed it to UTF-8 in Setting > Editor > File encodings but it didn't help. It's only changed the value to be like so ×ž×‘× ×” הקובץ ××™× ×• תקין
.
When I try is with English sentences as values it has no problem.