[Webkit-unassigned] [Bug 181181] The percent encoding in anchorElement.search depends on the encoding of the page

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 3 01:38:23 PST 2018


Pierre-Yves Gérardy <org.webkit at py.gy> changed:

           What    |Removed                     |Added
         Resolution|INVALID                     |FIXED

--- Comment #6 from Pierre-Yves Gérardy <org.webkit at py.gy> ---
Firefox is the only browser that treats location and <a> identically. Chrome and Safari both have location and new URL() work the same.

Also, the URL specification is not consistent, because it also states that

A percent-encoded byte is U+0025 (%), followed by two ASCII hex digits. Sequences of percent-encoded bytes, after conversion to bytes, should not cause UTF-8 decode without BOM or fail to return failure.

Yet it proceeds to describe an algorithm that produces non-UTF-8 sequences.


decodeURI and friends rely on this choke on non-UTF-8 sequences of perccent-encoded bytes. For Latin-1, unescape() works, but that's about it.

This is in the context of a SPA router that supports routes as pathname, search or hash (only one at a time :-). Since I can't even rely on location and <a> behaving consistently (for feature detection) I'll probably disable non-ascii routes if document.characterSet.toUpperCase() is not "UTF-8".

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180103/72002254/attachment-0001.html>

More information about the webkit-unassigned mailing list