Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing %2520 and other nonstandard characters from URL in obj c

I am getting a URL from server and trying to load the URL in webview. The issue is that the url which I am getting contains non standard characters. The URL is:

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 characters like %2520, %2F, %3D and other non standard characters from the URL. Anyone has idea to remove this encoding.
Any help would be appreciated

Thanks

like image 578
dead_soldier Avatar asked Jul 09 '12 05:07

dead_soldier


1 Answers

%2520 is simply a double-encoded space. Encode it once and you get %20, encode it twice and you get %2520. It's not "non-standard", it's just poorly coded. In theory, there's no reason why you can't just replace %2520 with a space, but for all I know the server-side code is expecting the double-encoded string.

like image 110
Niet the Dark Absol Avatar answered Sep 18 '22 21:09

Niet the Dark Absol