Hello Guest

Author Topic: TextMesh special characters  (Read 4673 times)

Afro-Ninja

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
TextMesh special characters
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TextMesh special characters
« Reply #1 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.

Afro-Ninja

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Re: TextMesh special characters
« Reply #2 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!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TextMesh special characters
« Reply #3 on: April 12, 2013, 12:27:53 am »
Glad it works.