- Home /
Unity multibyte support?
Hello, Does Unity support multibyte strings? I'm going to put some portuguese language into a text file and make the code read it and display it. Looks Unity support UTF-8 but not sure about multibyte. We'd like to support portuguese, japanese, chinese, koreans, and some of hebrew languages. Is there anybody who experiences Unity + Multibyte? If so, how? any sample codes are welcomed. Thanks,
Answer by Tetrad · Jun 22, 2010 at 12:48 AM
All strings in Unity are Unicode. UTF8 doesn't imply you can't support CJK, etc stuff. It just means that those characters are potentially larger than if you used UTF16.
The hard part about localizing Unity to non-latin-based languages is mainly that Unity uses a bitmap font instead of a font renderer. So to support Unicode your texture sheet will be potentially huge.
You don't really need to do anything special to support it, just make sure to have a font that has those characters. We localized a game we worked on to Thai, Chinese, Japanese... I don't know about right-to-left localization options, though.
If you really want to use UTF16, you can do so using System.Text.Encoding.UTF16.GetString(byte[]) and System.Text.Encoding.UTF16.GetBytes(string)
Edit: here's a screenshot http://yfrog.com/c9screenshot20100611at125p
Answer by binfantino · Jan 29, 2014 at 01:47 AM
Unity allows falling back to the system font for CJK however not Thai. Using sysfont is another alternative. Does anyone know of a way to specify an additional fallback font besides CJK?
Your answer
Follow this Question
Related Questions
Localize iOS App name from Unity 1 Answer
if statement isnt working 1 Answer
Writing to files in bytes. 1 Answer
Converting a float to a byte[]? Not working 2 Answers
Coordinate of matching pixel on texture 2 Answers