/// 汉字 UTF8 互转
NSString* strA = [@"%E4%B8%AD%E5%9B%BD" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *strB = [@"中国" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%@",strA); // 中国
NSLog(@"%@",strB); // %E4%B8%AD%E5%9B%BD
网友评论