标签:
-(void)NSUTF8StringEncodingAction{
//汉字与utf8相互转化
NSString *strA = [@"%E4%B8%AD%E5%9B%BD" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"汉字:%@",strA);
NSString *utf8CityNameStr = [@"iOS工程师" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"UTF8String:%@",utf8CityNameStr);
}
标签:
原文地址:http://www.cnblogs.com/xiangli/p/4207038.html