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
精彩评论