Skip to content

Instantly share code, notes, and snippets.

@jrturton
Created July 31, 2013 09:53
Show Gist options
  • Save jrturton/6120821 to your computer and use it in GitHub Desktop.
Save jrturton/6120821 to your computer and use it in GitHub Desktop.
Escaping reserved URL characters
-(NSString*)stringByPercentEscapingReservedURLCharacters
{
NSString *cleanedString = (NSString*)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (__bridge CFStringRef)self, NULL, (CFStringRef)@"!#$&'()*+,/:;=?@[]", kCFStringEncodingUTF8));
return cleanedString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment