login/register

Snip!t from collection of Alan Dix

see all channels for Alan Dix

Snip
summary

old escape(): encode in page's charset, then %hh
new escape(): %hh, %uhhhh for everything over unicode 256.
encodeURIComponent(): encode in UTF-8, then %hh

gemal.dk - Javascript escape()/unescape() NO LONGER suitable for URI manipulation
http://gemal.dk/blog.../javascript_escapeunescape_no_longer_suitable_for_uri_ma/

Categories

/Channels/techie/JavaScript

[ go to category ]

For Snip

loading snip actions ...

For Page

loading url actions ...

old escape(): encode in page's charset, then %hh

new escape(): %hh, %uhhhh for everything over unicode 256.

encodeURIComponent(): encode in UTF-8, then %hh

HTML

<p>old escape(): encode in page's charset, then %hh</p> <p>new escape(): %hh, %uhhhh for everything over unicode 256.</p> <p>encodeURIComponent(): encode in UTF-8, then %hh</p> <p></p>