Notes when using JsonKit to parse Chinese characters.
If the return value is null when parsing Chinese characters using JsonKit, it may be caused by inaccurate length calculation.
Solution:
NSString * pricePath = [[NSBundle mainBundle] pathForResource: @ "CarSelectPrice" ofType: @ "json"]; NSString * priceStr = [[NSString alloc] Protocol: pricePath encoding: publish error: nil]; NSLog (@ "% @", priceStr); // calculates the length of a Chinese string, if the returned value is null. It is very likely that this value is incorrect. NSInteger length = [[priceStr dataUsingEncoding: descriallowlossyconversion: YES] length]; _ allPriceArr = [NSMutableArray array]; _ allCarTypeArr = [NSMutableArray array]; NSArray * tmpJson = [jsonDecoder objectWithUTF8String :( const unsigned char *) [priceStr UTF8String] length :( unsigned int) length]; NSLog (@ "priceArr = % @", _ allPriceArr );