Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by PetterDK · Mar 27, 2012 at 01:44 PM · guicharactersencoding

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 'å'..

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

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.

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Mar 27, 2012 at 02:24 PM 0
Share

UTF-8 works fine; the docs are not correct.

avatar image PetterDK · Mar 29, 2012 at 08:13 AM 0
Share

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..

avatar image Seith · Mar 29, 2013 at 10:51 AM 0
Share

Any luck with that? I'm having the same problem...

avatar image PetterDK · Mar 29, 2013 at 11:10 AM 0
Share

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.

avatar image Seith · Mar 29, 2013 at 11:23 AM 0
Share

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?

Show more comments
avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges