Open GoogleCodeExporter opened 9 years ago
I just found a discussion on a similar issue on stackoverflow:
http://stackoverflow.com/questions/2295223/how-to-find-out-if-string-has-already
-been-url-encoded?lq=1. It enlightens me that since decodeURI() is harmless,
maybe we can decode an URL and then encode it again like this:
encodeURI( decodeURI(url) );
I think it should produce the expected result whether the given URL has been
encoded or not. Not sure. Still needs more tests.
Original comment by Humu2...@gmail.com
on 14 Oct 2014 at 9:53
[deleted comment]
It seems to work as intended. If you think people might enter unencoded URLs,
this would do the trick!
--
Sunny
http://github.com/sunny
Original comment by negatif@gmail.com
on 14 Oct 2014 at 5:55
Original issue reported on code.google.com by
negatif@gmail.com
on 13 Oct 2014 at 12:17Attachments: