I am able to replace space " " character in a URL but when there is a non-english character in it returns wrong URL. Example:
The URL I’m using : www.mostlifeclub.com/MostWeb/img/gallery2/7göller (2).jpg
The code I’m using:
tempUrl =
[tempUrl stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
What it returns me is:
http://www.mostlifeclub.com/MostWeb/img/gallery2/7göller%20(1).jpg
(some chinese characters added in there)
Therefore, I can not show the photo in my photo gallery.
What might be the problem?
have you tried stringByAddingPercentEscapesUsingEncoding method?