This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The spec currently says, in the query state of the URL parser: > If url's relative flag is unset or url's scheme is either "ws" or "wss", set encoding override to utf-8. The relative flag is only set of "ftp", "file", "gopher", "http", "https", "ws", and "wss" schemes. The query does not apply to "ftp", "file", or "gopher". This leaves only "http" and "https" schemes where the encoding override is relevant. Rather than adding all future relative schemes to the blacklist for this quirk, I suggest whitelisting. Change the quoted text to: > If url's scheme is neither "http" nor "https", set encoding override to utf-8.
Why does query not apply to those schemes? You can submit forms within file URLs for instance.
You can, but the query string is not transmitted over the wire for the server-side to process. Or, for the file scheme, there isn’t any server-side software that could process the query string.
Isn't client-side equally affected?
decodeURIComponent() always uses UTF-8, so using any other character encoding for percent-encoding seems more likely to cause mojibake when the query string is used on the client-side. http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
Sure, but what about compatibility? Or are you saying this is how it works today?
// ==UserScript== // @name Travian UI treak // @namespace http://userstyles.org // @description Travian UI treak with T3B ML&CN // @author gogonkt // @homepage http://userstyles.org/styles/30248 // @include http://travian.tw/* // @include https://travian.tw/* // @include http://*.travian.tw/* // @include https://*.travian.tw/* // @run-at document-start // ==/UserScript== (function() { var css = "#side_navi{\n width: 120px !important;\n float: right !important;}\n\n#side_info{\n width: 380px !important;}\n\n#tasklisttable_wrapper{\n padding: 0px !important;\n top: 535px !important; left: 30px !important; position: fixed !important;}\n\ntable>caption,#tasklisttable>tbody{\n display: none !important;}\n\n#res{\n left: 0px !important;}\n\n#mid{\n background: none !important;}\n\ntable tbody td{\n padding-left: 0px !important;}"; if (typeof GM_addStyle != "undefined") { GM_addStyle(css); } else if (typeof PRO_addStyle != "undefined") { PRO_addStyle(css); } else if (typeof addStyle != "undefined") { addStyle(css); } else { var node = document.createElement("style"); node.type = "text/css"; node.appendChild(document.createTextNode(css)); var heads = document.getElementsByTagName("head"); if (heads.length > 0) { heads[0].appendChild(node); } else { // no head yet, stick it whereever document.documentElement.appendChild(node); } } })();
This is now restricted to a whitelist, the special URLs minus ws/wss.