一般情况下针对于URL转码:
[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
但是对于含有特殊字符的就需要字符集转码:
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"#%<>[\\]^`{|}\"]+"].invertedSet];
网友评论