The locale might be a good tip. It would affect how the text is load but not how JME deals with it.
My first question then would be if you are sure that the string really contains the characters that you think it does. We don’t see how that message string was filled so it’s hard to say.
If the unicode values are correct and the font is correct then the text should display. There isn’t much magic going on beyond that. So either the font is bad or the unicode values in the string are bad.
that is how i use it DialogManager.showDialogue("שלום", this, guiNode);
i deed noticed that it works when i use escape seqence, and when i try to print the chars of this string as unicode, i get some wired 007d after it
also it might be relevant that if i try: char f = 'ף'
it not working and throwing the following exception:
Something between your editor, your Java, and your OS is getting confused about character encoding.
A character looks ok in your editor and it seems to interpret it for display… but when Java tries to compile it, it is not in the encoding expected. I think .java files are supposed to be UTF-8 by default. If your editor is using “platform encoding” then you may want to switch it.
Either way, it’s a problem with the contents of your string.
Else, I’m not sure what “switched” means in this case so I cannot comment further.
The contents of your Java string were incorrect. You’d have the same issue displaying them in a Swing UI. I’m not sure how we can help further because there is too much “specific to your setup” that we don’t know and is also 100% of the issue.
Edit: let me try to put it another way that may make it easier to spot the problem.
You type a Hebrew character into your editor. The editor displays it fine.
You save the file. You load the file again. The editor still displays it fine.
This makes sense because the editor is saving the file with the same encoding that it is reading it.
However, this file is NOT saved in UTF-8. So javac tries to read the .java file as UTF-8 and sees strange non-UTF nonsense where the Hebrew character should be. When it’s a ‘char’ literal… it tells you exactly this. When it’s in a String, it does its best to interpret it and ends up with garbage.
Your String has garbage in it. You try to display the garbage. And it looks like garbage.
This is why when you specifically escape the UTF characters it works.
Perhaps using localization files can help in this instance since we can put all the strings in a .properties file and let it handle that. It gives room to change locales and languages.
I suspect the original problem will crop up but you never know.
If you do figure out how to edit the localization files and have them retain the correct character encoding then you can also try editing your .java files that way, too.
Edit: though maybe one has more control over reading localization files? (I don’t remember.)