Created
April 30, 2012 08:28
-
-
Save hanksudo/2556549 to your computer and use it in GitHub Desktop.
Escape URL for iOS5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)escape:(NSString *)text | |
{ | |
return CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes( | |
NULL, | |
(__bridge CFStringRef)text, | |
NULL, | |
CFSTR("!*'();:@&=+$,/?%#[]"), | |
CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment