Snip
|
In all modern browsers (including Mozilla, now that bug ... JavaScript's escape() function (which was originally des... strings into URLs) uses %HH for Unicode codepoints below... %uHHHH for codepoints above there. Apparently, this is w... spec says.
|
---|
Categories |
|
---|
For Snip |
loading snip actions ... |
---|---|
For Page |
loading url actions ... |
HTML |
In all modern browsers (including Mozilla, now that <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=44272">bug 44272</a> is fixed), JavaScript's escape() function (which was originally designed for escaping strings into URLs) uses %HH for Unicode codepoints below 0x0100, but %uHHHH for codepoints above there. Apparently, this is what the ECMAScript spec says. Where did this strange %u encoding come from? The newer (but not supported by IE 5.0) encodeURIComponent() seems to do the right thing, always encoding each individual byte of the character's representation in UTF-8 as %HH. |
---|