网址中文编解码 URLEncode URLDecode
NSString *strUTF8 = @"太平洋保险(太保)人保,平保,人寿"; //urlencode : NSString *strUrl = [strUTF8 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //urldecode 解析网址上中文时用到 NSString *strUrlDecode = [strUrl stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; //在线工具 http://tool.chinaz.com/Tools/URLEncode.aspx 自己打开网址时,带中文参数时,需要编码 - (NSString*)URLencode:(NSString *)originalString stringEncoding:(NSStringEncoding)stringEncoding { //! @ $ & ( ) = + ~ ` ; ' : , / ? //%21%40%24%26%28%29%3D%2B%7E%60%3B%27%3A%2C%2F%3F NSArray *escapeChars = [NSArray arrayWithObjects:@";" , @"/" , @"?" ,