Removing% 2520 and other non-standard characters from URLs in obj c

I am getting the url from the server and trying to load the url into webview. The problem is that the url I get contains non-standard characters. Url:

https//p-r3.test.abc.com:443%2Ftablet%2Fjsp%2Fgift%2Fipad%2Fgifter%2FgitGiftList.jsp%3FregId%3D74500002%26filterBy%3DviewAll%26pageId%3DourGifty%26sort%3Dcategory%26groupBy%3Dcategory%26view%3Dlist%26categoryId%3D%26addCat%3Dcat100540004&title=re%20-&imgurl=https%3A%2F%2Fm-r3-testy.tr.com%3A443%2Ftablet%2Fimages%2Ft_Full.jpg%3Fwid%3D300%26hei%3D300.

I need to remove the symbols, such as %2520, %2F, %3Dand other non-standard characters in the URL. Someone has an idea to remove this encoding.
Any help would be appreciated

thank

+5
source share
4 answers

%2520 - . , %20, %2520. "", . , %2520 , , , .

+7

, , urlencode(), urldecode() , URL.

+1

Found the answer. I delete the encoding using the built-in iOS function.abc = [def stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

and I load abc in webview. It is working fine. Thanks to everyone for the answers.

+1
source

To avoid multiple encoding, first remove the encoding

   _pdfUrl = [ _pdfUrl stringByRemovingPercentEncoding];        
   _pdfUrl = [_pdfUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
0
source

All Articles