ios中对url中得特殊字符处理

1 NSString *UrlEncodedString(NSString *sourceText)
2 {
3     NSString *result = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,(CFStringRef)sourceText ,NULL ,CFSTR("!*'();:@&=+$,/?%#[]") ,kCFStringEncodingUTF8));
4     return result;
5 }

posted on 2014-07-22 14:27  K's Blog  阅读(3903)  评论(0编辑  收藏  举报

导航