2D Toolkit Forum

2D Toolkit => Support => Topic started by: Afro-Ninja on April 11, 2013, 08:25:58 pm

Title: TextMesh special characters
Post by: Afro-Ninja on April 11, 2013, 08:25:58 pm
I have created a text mesh with a font exported from BMFont. It includes a few special romanian characters (such as ș)
The characters are there because when I type them in the 'text' property of the text mesh inspector, they show up on the screen.

but, if I set them programatically:
myMesh.text = "șpecial characterș";
myMesh.Commit();

my result on the screen would be: "pecial character"

suggestions?
Title: Re: TextMesh special characters
Post by: unikronsoftware on April 12, 2013, 12:12:36 am
What text editor are you using? Is it writing it out correctly? I think it needs to be UTF8...
What does Debug.Log of the string print out?

Alternatively, you can find the unicode character for this and use unicode escapes (\udddd - dddd = 4 character unicode code) in the string to ensure it works.
Title: Re: TextMesh special characters
Post by: Afro-Ninja on April 12, 2013, 12:26:46 am
I'm using monodevelop and the characters appear correctly there

I switched to unicode escape sequences and it worked perfect, thanks!
Title: Re: TextMesh special characters
Post by: unikronsoftware on April 12, 2013, 12:27:53 am
Glad it works.