有一个QueryString字符串,形如@"oauth_consumer_key=7w8q7wea43c0054d26958339d3413&oauth_nonce=9210314&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1315591869"
我想对它进行url转义,用了stringByAddingPercentEncodingWithAllowedCharacters方法,但是其中的"="和"&"并没有被转义。为什么?
[querySting stringByAddingPercentEncodingWithAllowedCharacters:
[NSCharacterSet URLQueryAllowedCharacterSet]];
大家讲道理2017-04-17 17:55:26
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=
According to what is said here, the above are all legal, including = and &
http://stackoverflow.com/a/1547940