I have to access a web server using a GET
with international characters (Hebrew in my case but could be anything).
So I make an NSString
just fine
+ (NSURL*) URLWithStringWithSpecialChars:(NSString *)sURL
{
NSURL *url = [NSURL URLWithString:sURL];
if(url == nil)
return [NSURL URLWithString:[sURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
else
return url;
}
calling this function instead of URLWithString: should ensure that a valid NSURL is always returned (instead of nil when needed)