- From: Pierre-Yves Gérardy <notifications@github.com>
- Date: Wed, 27 Dec 2017 01:35:47 +0000 (UTC)
- To: whatwg/encoding <encoding@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 27 December 2017 01:36:11 UTC
Apologies if it is not appropriate, but I'm puzzled by a quirk of `encodeURI` that's consistent across browsers yet I think not Unicode compliant. While `encodeURI` correctly rejects the `U+d800` - `U+dfff` range, it also refuses to convert the corresponding code points in the astral planes. So `encodeURI(String.fromCharCode(0x1d800))` fails with a URIError: malformed URI sequence`. Since it is consistent across browser ([try here](https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvEAXwvW10QICsEqdBk2J4hcYgAIoGCZIC8kgA4YATnBgBJBgAoAOiACMABgBi50wYqTDANgCUetE4BuaybQDWCycVUBXGCcwWlVJHVgpCB9jAG5JaIAeRRkJeIgAagz7YCdJSXEpOB8AZT8INABzfDBVWiwAYUI1BtoAExgdCEc0fL8AT0lc3vyC+jkAd1kvHy880aY6DoBVACVNHTge0Y9vRT9A+fyIMHCAQim4L3sxtCvYfChaSv0QVKkAIww2yStw6IAtDZ7PhiLQyqoKi87PZtpJWAUMMRqIRwjAbsMdidwtdbvcYI9nq9IOpPt8-hBQeDylUdDC4fkZoowBgoBp5qwnJznGglK82vQgiB7GwOCBMDg8PhqHABDR6IxmDw2ABdVhAA), I tested Firefox, Chrome, Edge and Safari), I was wondering if the behavior was deliberate, whether it is a spec bug, or whether everyone coincidentally makes the same mistake (the latter seems unlikely). -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/encoding/issues/131
Received on Wednesday, 27 December 2017 01:36:11 UTC