开发者

URL String containing %26 converts when escaped using NSString

I have a URL string which contains a %26

the part in the URL string is : http://开发者_如何学C......(bkd %26 2)=2..........

I am using the following line of code to take care of escape characters for creating a valid URL:

NSURL *url = [NSURL URLWithString:[scriptURLString stringByAddingPercentEscapeUsingEncoding:NSUTF8StringEncoding]];

When I the NSMutableURLRequest to post the data, there is an error in getting the response.

The part of the URL string above given in bold is now set in the URL string as : %202=2 instead of %20%26%202%29=2

How do I make sure it is encoding correctly?

Please advice.

Thanks,

Subbu

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜