Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 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 /
  • Help Room /
avatar image
2
Question by PudgePacket · Mar 24, 2015 at 02:24 PM · html5unicode

Enabling unicode in html5 builds

I'm writing a small quiz game for the browser. The problem I'm getting is that the Japanese characters aren't rendering in browser (HTML5 build).

Editor:

alt text

Browser:

alt text

I'm using Japanese characters in my code like so

 private Dictionary<string, string> quiz_answers = new Dictionary<string, string>(){
     {"a", "ア"}, {"i", "イ"}, {"u", "ウ"}, {"e", "エ"}, {"o", "オ"}
 };


I've tried converting them to unicode characters but I think it doesn't change anything.

 '\u30A2'.ToString()

editor.png (3.1 kB)
browser.png (2.6 kB)
Comment
Add comment · Show 1
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 mnml_ · Jul 22, 2015 at 08:19 PM 0
Share

same problem here :'(

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by HenrikNielsen · Sep 12, 2016 at 01:04 AM

I had the same problem.

It turned out that the font I was using didn't support the special characters I was using. It worked nontheless in the editor and in PC-builds, because in these cases Unity uses a different fallback-font to render the special characters. But in WebGL-builds, Unity can't access these fallbacks:

From https://docs.unity3d.com/Manual/class-Font.html

Note that some target platforms (WebGL, some consoles) do not have OS default fonts Unity can access for rendering text. [...] All fonts to be used as fallbacks must be included in the project, so if you need to render international text or bold/italic versions of a font, you need to add a font file which has the required characters to the project [...]

To find a font that supported the special characters I needed, I used the Windows character map (Press Windows-key + R, then type "charmap") as well as pages like http://www.fileformat.info/info/unicode/char/21d4/index.htm

I found a font that had everything I needed, and I am using that font as my main font. You can use the font as a fallback-font instead, just read the first page I linked to.

The Unity manual also says:

Note that fonts are subject to copyright and you should only include fonts that you have licensed or created for yourself.

It can be hard finding a completely free font that support some special characters. If so, you have to pay for a license (even fonts like Arial requires a license when embedded in applications)
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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Publish a game in the Chrome web store 1 Answer

dose anyone understand this Html5 error message 0 Answers

WebGL Stops all keyboard input for HTML inputs 1 Answer

Black lines appear after I build my game (only on HTML5),I get lines in my textures after building my game 0 Answers

How to embed my Unity OpenGL game to my website? 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