Johan Bååth

Senior Software Developer in Stockholm


encodeURIComponent in Objective-C

Objective-C

NSString *str = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (__bridge CFStringRef)someStringToEncode, NULL, (__bridge CFStringRef)@"!*'\"();:@&=+$,/?%[]% ", CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));

JavaScript

var str = encodeURIComponent(str);

30bea914dbe40c224d53e671e903efb8cd6bafe2b599f8fd341ed8136af75f23.jpg

View →