+ (NSString *)urlEncode:(NSString *)url {
NSString *charactersToEscape =@"[]";
NSCharacterSet *allowedCharacters = [[NSCharacterSet characterSetWithCharactersInString:charactersToEscape] invertedSet];
NSString * urlStr = [url stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];
return urlStr;
}
+ (NSString *)urlDecode:(NSString *)url {
NSString* decodedString = [url stringByRemovingPercentEncoding];
return decodedString;
}
网友评论