- (NSString *)stringConvert:(NSString *)string{
//过滤不能打印的ASCII码
NSMutableString *str = [NSMutableString stringWithString:string];
for (int i = 0; i < str.length; i++) {
int ascii_code = [str characterAtIndex:i];
//31 之前的都是 ASCII中的控制符 128之后都是扩展字符 都是不可见字符 json 解析不了
NSRange range = NSMakeRange(i,1);
if (ascii_code <= 31 || (ascii_code>= 128 && ascii_code<=255)) {
[str deleteCharactersInRange:range];
--i;
}
}
return (NSString *)str;
}