Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 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 /
avatar image
0
Question by CosgunHalil · Oct 06, 2015 at 12:20 PM · jsonlocalizationjsonfx

JsonFx Deserialize Special Characters

I have a problem with deserializing special characters using Json.fx. When I try to serialize characters like "ğ,ş,ü", Jsonfx.Serialize and Jsonfx.Deserialize functions don't work correctly.

I try to solve Localization problem for my application. Help me please.

Here is my classes :

public class Language { public int LanguageId; public Menu menu; public Language() { menu = new Menu(); }
}

public class Menu { public List MenuStrings;

 public Menu()
 {
     MenuStrings = new List<string>();
 }

}

public class Localization : MonoBehaviour { public TextAsset LanguageFile; private List _languages ;

private void Awake() { Language Example = new Language(); Example.LanguageId = 7; Example.menu.MenuStrings.Add("İskeğderinoviş"); Example.menu.MenuStrings.Add("ŞağmiI"); Example.menu.MenuStrings.Add("Şjikovamoğviş");

     Debug.Log(JsonWriter.Serialize(Example));

}

Log Message :

{"LanguageId":7,"menu":{"MenuStrings":["\u0130ske\u011Fderinovi\u015F","\u015Ea\u011FmiI","\u015Ejikovamo\u011Fvi\u015F"]}} UnityEngine.Debug:Log(Object) Localization:Awake() (at Assets/Scripts/Localization.cs:155) Thanks for your time.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Dave-Carlile · Oct 06, 2015 at 12:54 PM

What is incorrect? Json uses Unicode to encode non-ASCII characters. For example, \u011F is the encoding for ğ. It appears to be working correctly to me.

Edit: Here are the syntax diagrams for Json: http://www.json.org/fatfree.html. It appears that a JSON string can be the actual Unicode letters, or the \uNNNN format. Why JsonFx is using the latter I don't know. Maybe that's a setting?

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

30 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

JSONFX, Reading JSON Object 1 Answer

Loading Different Languages #Localization ResX vs Json 0 Answers

Loaclization in WebGL? 1 Answer

JSON and Javascript 0 Answers

Can anyone tell me what's wrong in this, I try to post values to API 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