LitJSON / litjson

JSON library for the .Net framework
https://litjson.net/
Other
1.36k stars 403 forks source link

JsonMapper and accents #48

Open MedianP opened 8 years ago

MedianP commented 8 years ago

Hi ! I can't manage to fix this issue, any idea ?

I have this Json =

[{"id":"CS_001","name":"L'élément","type":"Tôt"},{"id":"CS_002","name":"L'outrage","type":"Tôt"},{"id":"CS_003","name":"Test","type":"Tôt"}]

Public class test : MonoBehaviour { private string jsonString; private JsonData cardData; JsonData database;

void Start () {
    jsonString = File.ReadAllText (Application.dataPath + "/test.json");
    cardData = JsonMapper.ToObject (jsonString);
    database = JsonMapper.ToJson (cardData);
    Debug.Log (database.ToString ());
    File.WriteAllText (Application.dataPath + "/carte2.json", database);
}

}

The Debug.Log and the File are = [{"id":"CS_001","name":"L'\u00E9l\u00E9ment","type":"T\u00F4t"},{"id":"CS_002","name":"L'outrage","type":"T\u00F4t"},{"id":"CS_003","name":"Test","type":"T\u00F4t"}]

I would like to keep the accents into the json, is that possible? Thank you