litJson에서 %문자가 파싱 되지 않는 현상

Unity3D 2014. 11. 26. 16:13
반응형

litJson에서 %문자가 파싱 되지 않는 현상

웹에서 받아온 byte[] 를 문자열로 파싱해서 사용했을때는 문제없던 데이터들이

로컬에서 json파일을 만들어서 파싱해보니 %문자에서 invailed exception뜸.

http://lbv.github.io/litjson/docs/quickstart.html#mapping-json-to-objects-and-vice-versa

 

임시로 SimpleJSON을 쓰기는 했음.

http://wiki.unity3d.com/index.php/SimpleJSON#Download

 

public void LoadLanguageInfo(HTTPRequest req, HTTPResponse resp)
 {
  //WaitingTimer.GetInstance().ActivateTimer();
  //WaitingTimer.GetInstance().SetDisplayText("Loading Language");

  if (resp == null)
  {
   Debug.LogError("Request Language Fail.");
   string filePath = "Data/Json/Language";
   TextAsset data = (TextAsset)Resources.Load(filePath);

            Debug.Log(data);

            JSONNode node =  JSON.Parse(data.text);


            //JsonData node = JsonMapper.ToObject(System.Text.Encoding.UTF8.GetString(StrByte));
            Debug.Log(node);

   //JsonData node = JsonMapper.ToObject(data.ToString());


            JsonParser.LanguageParsingLocalJson(ref node);

   //WaitingTimer.GetInstance().DeactivateTimer();
  }
  else
  {
           
   JsonData node = JsonMapper.ToObject(System.Text.Encoding.UTF8.GetString(resp.Data));
   int resultCode = Convert.ToInt32(node["result"].ToString());
   
   if (resultCode == 1)
   {
    JsonParser.LanguageParsingJson(ref node);
    //WaitingTimer.GetInstance().DeactivateTimer();
            }
   else
   {
    Debug.LogError("Error - LoadLanguageInfo(Code : " + resultCode + ")");
    return;
   }
  }
 }

반응형

'Unity3D' 카테고리의 다른 글

3D 렌더링 파이프 라인  (0) 2015.01.05
Doxgen과 Graphviz  (0) 2014.11.27
List 검색  (0) 2014.11.26
유니티의 iOS 빌드는 왜 다른가?  (0) 2014.11.25
Excel to json converter  (0) 2014.11.25
: