{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/html/issues/394","labels_url":"https://api.github.com/repos/whatwg/html/issues/394/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/html/issues/394/comments","events_url":"https://api.github.com/repos/whatwg/html/issues/394/events","html_url":"https://github.com/whatwg/html/issues/394","id":121627937,"number":394,"title":"4.6.3 maybe the decoding done by URI parts getters could be standardized?","user":{"login":"pygy","id":54515,"avatar_url":"https://avatars.githubusercontent.com/u/54515?v=3","gravatar_id":"","url":"https://api.github.com/users/pygy","html_url":"https://github.com/pygy","followers_url":"https://api.github.com/users/pygy/followers","following_url":"https://api.github.com/users/pygy/following{/other_user}","gists_url":"https://api.github.com/users/pygy/gists{/gist_id}","starred_url":"https://api.github.com/users/pygy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pygy/subscriptions","organizations_url":"https://api.github.com/users/pygy/orgs","repos_url":"https://api.github.com/users/pygy/repos","events_url":"https://api.github.com/users/pygy/events{/privacy}","received_events_url":"https://api.github.com/users/pygy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-11T03:18:00Z","updated_at":"2015-12-14T16:02:42Z","closed_at":"2015-12-13T01:40:26Z","body":"Whether `a.pathname`, `.search` and `a.hash` should be URI decoded isn't specified AFAICT, and browsers vary widely.\r\n\r\nGiven this:\r\n\r\n```JS\r\na = document.createElement('a');\r\na.href = \"/ö/o?ö/o#ö/o\";\r\nconsole.log(a.pathname, a.search, a.hash);\r\n```\r\n\r\nwe get:\r\n\r\nUA | `.pathname` | `.search` | `.hash`\r\n--- | ------- | ----------- | ---------\r\nChrome | `/%C3%B6/o` | `?%C3%B6/o` | `#ö/o` !\r\nFirefox | `/%C3%B6/o` | `?%C3%B6/o` | `#%C3%B6/o`\r\nSafari | `/%C3%B6/o` | `?%C3%B6/o` | `#%C3%B6/o`\r\nEdge  | `/ö/o` | `?ö/o`  | `#ö/o`\r\nIE11  | `ö/o` !! | `?ö/o`  | `#ö/o`\r\n\r\nI don't have a Windows machine at hand, the last two results were communicated to me over chat... Apparently, all but IE11 follow the living standard, but in a way that requires per getter feature detection:\r\n\r\n```JS\r\n// Imagine we're in an event handler, and given `a` as defined above:\r\nvar hash = ((/ö/.test(a.hash) ? String : decodeURI)(event.currentTarget.hash);\r\n```\r\n\r\nOther URI getters are probably also concerned, I didn't test anything beyond these three.\r\n\r\nAlso, I don't know how trailing slashes are handled in MS Browsers. In the first three, they are preserved.\r\n\r\nIt would be nice if it could be harmonized, or at least if within UA consistency was required. I'm rooting for the Edge approach, personally."},"comment":{"url":"https://api.github.com/repos/whatwg/html/issues/comments/164476297","html_url":"https://github.com/whatwg/html/issues/394#issuecomment-164476297","issue_url":"https://api.github.com/repos/whatwg/html/issues/394","id":164476297,"user":{"login":"annevk","id":1544111,"avatar_url":"https://avatars.githubusercontent.com/u/1544111?v=3","gravatar_id":"","url":"https://api.github.com/users/annevk","html_url":"https://github.com/annevk","followers_url":"https://api.github.com/users/annevk/followers","following_url":"https://api.github.com/users/annevk/following{/other_user}","gists_url":"https://api.github.com/users/annevk/gists{/gist_id}","starred_url":"https://api.github.com/users/annevk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annevk/subscriptions","organizations_url":"https://api.github.com/users/annevk/orgs","repos_url":"https://api.github.com/users/annevk/repos","events_url":"https://api.github.com/users/annevk/events{/privacy}","received_events_url":"https://api.github.com/users/annevk/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T16:02:42Z","updated_at":"2015-12-14T16:02:42Z","body":"> in Chome and Safari, the value returned by the origin getter is Punycode encoded too.\r\n\r\nOh wow, you might want to file issues for that against the specification. Perhaps we should change `origin`, but then `postMessage()` might need changes too. Ugh.\r\n\r\n`URL.domainToUnicode()` does more than just Punycode, since domains names use more than just Punycode, but it's close.\r\n\r\nThe URL standard is set in stone, modulo any outstanding issues and further implementation feedback."}}