JSONKit雖然很強(qiáng)大幸逆,但是一些特殊的unicode却嗡,比如\u0000是無(wú)法解析的纵隔。在github上作者解釋了這個(gè)問(wèn)題翻诉,說(shuō)這個(gè)是內(nèi)容提供的錯(cuò)誤炮姨,不符合標(biāo)準(zhǔn)的內(nèi)容,所以他不認(rèn)為這個(gè)是自己的錯(cuò)誤碰煌,這個(gè)是內(nèi)容提供者的問(wèn)題舒岸。作者的原話如下:
In this particular case, these services are very clearly "in the wrong". RFC 4627 is unambiguous that characters < 0x20are verboten. In cases like there, where something is clearly violating the standard, my default response is that "It's the other persons (web service) problem." The standard is the standard, and it is Right(tm), even its mistakes.
后來(lái)我使用了SBJson,解析成功芦圾。NSJSONSerialization蛾派,解析成功。
所以如果你喜歡使用JSONKit个少,但是你要解析的unicode中含有\(zhòng)u0000的話洪乍,就要特殊處理,做判斷夜焦,個(gè)人比較喜歡NSJSONSerialization壳澳,以上。