Change HTML characters in URL in xcode
given a URL like this:
http%3A%2F%2Fwww.environmental-expert.com%2FresultEachPressRelease.aspx%3Fcid%3D23745%26codi%3D2开发者_StackOverflow34441%26lr%3D1
How can i replace the characters (like %3D and so on) to get a normal url using the iphone sdk?
thanks in advance!
Try:
NSString *myEscapedUrl = @"http%3A%2F%2Fwww.environmental-expert.com%2FresultEachPressRelease.aspx%3Fcid%3D23745%26codi%3D234441%26lr%3D1";
NSLog(@"my unescaped url: %@", [myEscapedUrl stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]);
精彩评论