Unity UNICODE issue

From ETC Public Wiki
Jump to: navigation, search

Unicode

File:SaveVS.png

When you need to display characters from Asian languages (Japanese, Chinese, etc.) from Unity script, you need the change the encoding to Unicode.
Unfortunately, you won't be able to do that with MonoDevelop.
If you try to save the file as Unicode(UTF-16) in MonoDevelop, it will result in file crash (when you restart Mono), and you will lose all your work.
You need another application to do the conversion. Here is an example using Visual Studio.

  1. Open your script with Visual Studio.
  2. Go to File -> Save xxx as -> Save with Encoding...
  3. Select Unicode - Codepage 1200


Once you did the conversion, you can go back to MonoDevelop, make changes and save with MonoDevelop.
It won't crash and you don't need to do conversion again; it will keep its encoding settings.

In order to display Asian characters, you still need to handle font issues. Please refer to Unity font issue on iOS/Android for more information.