海神


把字符串进行URL转义的函数

2011-06-23
@implementation NSString (Escaping)
- (NSString*)stringWithPercentEscape 
{                
return [(NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)[[self mutableCopy] autorelease], NULL, CFSTR("=,!$&'()*+;@?n"<>#t :/"),kCFStringEncodingUTF8) autorelease];
}
@end

blog comments powered by Disqus