Closed zhangmazi closed 10 years ago
mergJSON uses UTF8 encoding so you will need to encode it as UTF16 for use in LiveCode
code: put JSONToArray(str_json) into arr_json
I had done it. but the result is incorrect Chinese. where is the wrong...please help me.
Are you sure the original unicode codepoints are correct and have you tried encoding and decoding the correct Chinese chars to JSON?
I have writed json string at under url. and it responed write header with utf8 charset(no bom) http://www.ninja911.com/json_demo_mobile.php can you take a minute to test it ?
I already did do this test and I got what looked like Chinese chars but not knowing Chinese I don't know if they are correct.
I sent a email to your monte@goulding.ws. please receive it.
The issue was solved.
set the unicodeText of field "TxtResult" to uniEncode(str_result, "utf8")
answer the text of field "TxtResult"
Thanks.
My json contain Chinese and the charset "\uxxxxxxx\uxxxx" example json string: [{"blog_id":"73","title]":"asdasdsadasd","tcolor":"","tbold":"0","short_name":"asdasdsadasd","cat_id":"2","cat_name":"\u751f\u6d3b\u7410\u788e","blog_type":"standard","small_pic":"","hits":"1","post_date":"2014-03-30","status":"1","sticked":"0","keywords":"dd","total_comment":"0","access_way":"1","access_pname":"","nick":"\u5f20\u9ebb\u5b50"},{"blog_id":"72","title]":"asdasdasd","tcolor":"","tbold":"0","short_name":"asdasdasd","cat_id":"3","cat_name":"PHP\u4e4b\u8def","blog_type":"standard","small_pic":"","hits":"1","post_date":"2014-03-30","status":"1","sticked":"0","keywords":"asdasdasd","total_comment":"0","access_way":"1","access_pname":"","nick":"\u5f20\u9ebb\u5b50"}]
My IDE is Livecode 7.0 dp6 On Windows8 bit64