- Home /
Scandinavian letters 'Æ', 'Ø' and 'Å'
Whenever I use these letters in e.g. GUI, they always come out like this: "??" instead.. I suspect that it has something to do with the encoding of the scripts I'm using, but AFAIK MonoDevelop is already using UTF-8 as default.
This is based is this thread on the forums..
So, have anyone had the same problem and maybe a solution to it?
UPDATE: I tried to save one of my scripts containing the special characters as UTF-16 in MonoDevelop and then use that script instead of the default UTF-8. Still question marks instead of 'æ', 'ø' and 'å'..
Answer by Kryptos · Mar 27, 2012 at 02:11 PM
You should use UTF-16 (UCS-2 Little Endian), not UTF-8.
See http://unity3d.com/support/documentation/Components/class-Font.html
You also need to use a font that support those characters.
Thank you for your answers.. However I am looking for actual help with getting these characters into UnityGUI. When I'm using e.g. GUI.Label()
right now, the scandinavian characters are just co$$anonymous$$g out like question marks.
The question of UTF-8 or UTF-16 is all very good, but I need help as to how to get Unity to display these characters inside OnGUI functions..
Yes, hat $$anonymous$$ryptos said in his answer to the question has worked out for me.. You need to make sure that the script you are using to display text is encoded with UTF-16.
I did that, but it didn't change anything. The problem is when I say for example:
Debug.Log("Français");
What I get in the console ins$$anonymous$$d is Français. So this seem to be a Unity problem, doesn't it?
Answer by GerryM · Apr 04, 2013 at 06:09 PM
If you "type" the unicode characters in your editor you might run into such issues, especially when using your source code on multiple platforms or in different editors.
As a first solution you can hard code the unicode character into your text, something like:
Debug.Log ("Fran\u00E7ais");
This will ensure a proper display in the console and in the GUI.
However, hard coding strings into your source code isn't considered the best practice. If you need lots of (international) text, consider saving it in an asset file (also useful for localization), where you can ensure that it's stored with the proper encoding.link text
Your answer
![](https://koobas.hobune.stream/wayback/20220613065608im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Question about foreign language characters on GUI 2 Answers
Cyrillic characters displays as question marks. 0 Answers
Using Polish characters in OnGUI 1 Answer
How can I convert UTF8 string to arabic? 2 Answers
Scandinavian letters for iOS export 1 Answer