Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
2
Question by Zhang Kun · Apr 29, 2010 at 10:31 AM · textunicodeutf-8encode

Does Unity support UTF-8 string/text?

All string/text in our project are in UTF-8 format. Some string should be displayed in GUI. The online document says Unity support ttf font file and Unicode(UTF-16), can it support UTF-8. If not, is there any work can be done?

I am evaluating Unity3D, for whether it is suitable for Web MMORPG game. We are in China, our game should support all east asian lanuages.

BTW. We have our own game server, written in C++, we will use .net socket directly and use our own byte stream protocol. All text in server side and DB are in UTF-8.

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

5 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by duck · Apr 29, 2010 at 10:38 AM

Yes, it does.

I have used UTF-8 files as text assets in Unity, and (providing you have embedded a Unicode font), it displays the characters properly.

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
avatar image
1

Answer by Ray-Pendergraph · Apr 29, 2010 at 02:08 PM

The Mono (.NET) character is a unicode character. C# strings (for instance) are strings of unicode characters regardless of the source they were read from, including a UTF-8 source. So like Duck said it just works if it's in the font. The gotcha for you may be that Unity only supports left-to-right languages out of the box. This was a big thing we ran into looking into implementing some text in some Persian languages. So depending on the language, this might affect you.

Comment
Add comment · Show 1 · 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 Zhang Kun · May 04, 2010 at 07:01 AM 0
Share

Yes, C# string is in Unicode and it is very convenient to convert it to/from utf-8. So in client side, we will use C# and unicode; and in server side, we will use utf-8. We only support left-to-right lanuages:)

avatar image
1

Answer by Eric5h5 · Apr 29, 2010 at 04:54 PM

One problem with supporting all Asian languages is that fonts in Unity must be pre-rendered to a texture. This can limit fonts to an unreadably small size since all characters must fit in a 2048x2048 texture. This can be alleviated somewhat if you decide to leave out support for older cards and Intel GMA chips, and use a 4096x4096 texture.

Edit: note that this answer only applies to Unity 2.6 and earlier. Unity 3.0 uses dynamic font rendering.

Comment
Add comment · Show 1 · 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 Zhang Kun · May 04, 2010 at 07:07 AM 0
Share

Yes, the codepoint number/font texture size for East Asian font is a problem. 2048 x 2048 is the size almost all video card can support.

I suggest Unity uses such solution, Use a dynamic font texture with small size(for example, 512 x 512), the texture just hold codepoints which are being displayed. Some FIFO algorithm can be used.

avatar image
0

Answer by bnmindstorm · Jun 29, 2012 at 11:38 AM

We did create a package that supports asiatic fonts by rendering them directly as text mesh and thus not using Textures to store the font. If you think you may be interested by this package, have a look at our website : http://ttftext.computerdreams.org/

alt text


ttftextasiatic.png (297.9 kB)
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
avatar image
0

Answer by ND · Sep 12, 2012 at 09:51 PM

Support of right to left Arabic/ Persian / Kurdi right to left unicode in GUI:

Asset Store

Online Demo

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

2 People are following this question.

avatar image avatar image

Related Questions

How to implement colored emojis in TMPro? 0 Answers

I want pixelated unicode text. Need suggestions... 2 Answers

GUI.PasswordField "•" makes "?" 1 Answer

How do I convert from unicode to surrogate pairs? 2 Answers

How to encode german umlaute when laoding local stored data via WWW class? 0 Answers


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