UTF-8解码 转码
2018-05-08 本文已影响0人
竹子4117
UTF-8解码
NSString* str= [@"%E4%B8%AD%E5%9B%BD" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"str=%@", str);
UTF-8转码
NSString* str = [@"我是中文" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"str=%@", str);