Author Topic: Problem with encoding  (Read 4771 times)

skinsomnia

  • Guest
Problem with encoding
« on: April 09, 2013, 12:33:31 PM »
Hi,
Great product btw, I bought NGUI a while ago and everything went smoothly up to this point. I ran into a weird problem today with cyrilic letters on NGUI labels. When I enter the label text through the inspector it works fine. When I try to change the text field during runtime through a script tho, characters are displayed all messed up. Any idea on how to fix that?

Thanks,
Zdravko

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with encoding
« Reply #1 on: April 09, 2013, 09:36:24 PM »
Your code file must be saved as UTF-8 with signature.

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: Problem with encoding
« Reply #2 on: April 10, 2013, 05:21:26 AM »
My trick is to use this website to escape the special characters so it does not mess up the characters in NGUI.

Unicode escape notations generator
http://luracast.com/blog/unicode-escape-notations-generator_752/

Just paste the text and press the "convert to notation" Button.

Saving the script files as UTF8 does not work for me the most time , so i can work around it.

sparrow

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Problem with encoding
« Reply #3 on: October 01, 2013, 05:55:58 PM »
Would be really cool if this class would decode Unicode escaped characters in jsonDecode function.