PDA

View Full Version : Problem with Ampersand char in the URL




oceandrive
Apr 1, 2009, 07:59 AM
how do we pass a string Mr.X & Mr.Y in the URL.

I have tried this but this one does all the chars but ampersand.

[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]

Thanks for the help.



blackmesa
Apr 1, 2009, 08:48 AM
An URL can contain &. Something like http://forums.macrumors.com/newreply.php?do=newreply&noquote=1&p=7387369 is valid.


Searching through google I've stumbled upon this (http://jongampark.wordpress.com/2009/03/21/bugs-in-stringbyaddingpercentescapesusingencoding/).


I searched on google:"stringByAddingPercentEscapesUsingEncoding doesn't work for &"

Maybe it helps...