UTF-8解码 转码

UTF-8解码

NSString* str= [@"%E4%B8%AD%E5%9B%BD" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];  

NSLog(@"str=%@", str);

UTF-8转码

NSString* str = [@"我是中文" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

NSLog(@"str=%@", str);

你可能感兴趣的:(UTF-8解码 转码)