How can I encode this url to be displayed in a UIWebview:
http://de.wikipedia.org/?search=Bevölkerungsentwicklung
I tried:
-stringByAddingPer
Just use below sample code;
NSString *urlstring = [NSString stringWithFormat:@"http://de.wikipedia.org/?search=%@", searchString]; NSString *encodedString = [urlstring stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *url = [NSURL URLWithString:encodedString];