标签:
encode
NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,(CFStringRef)self,NULL,CFSTR("!*‘();:@&=+$,/?%#[]"),kCFStringEncodingUTF8);
decode
NSString *result = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,(CFStringRef)self, CFSTR(""),kCFStringEncodingUTF8);CFSTR(""),kCFStringEncodingUTF8);
关键地方 是这个匹配的符号的转换
CFSTR("!*‘();:@&=+$,/?%#[]")
标签:
原文地址:http://www.cnblogs.com/tianlin106/p/5206664.html