utf-8 转码--网址转码

NSString *name = @"联通测试";
NSString *utfName = [name stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
NSString *tempName = [utfName stringByRemovingPercentEncoding];

 打印:utf:%E8%81%94%E9%80%9A%E6%B5%8B%E8%AF%95    temp:联通测试

posted @ 2016-05-30 16:50  沈红榜  阅读(263)  评论(0编辑  收藏  举报