mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
gh-63283: IDNA prefix should be case insensitive (GH-17726)
Any capitalization of "xn--" should be acceptable for the ACE prefix (see https://tools.ietf.org/html/rfc3490#section-5). Co-authored-by: Pepijn de Vos <pepijndevos@gmail.com> Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
ce2c996b2f
commit
d180b507c4
3 changed files with 12 additions and 3 deletions
|
@ -1547,6 +1547,13 @@ class IDNACodecTest(unittest.TestCase):
|
|||
self.assertEqual(str(b"python.org.", "idna"), "python.org.")
|
||||
self.assertEqual(str(b"xn--pythn-mua.org", "idna"), "pyth\xf6n.org")
|
||||
self.assertEqual(str(b"xn--pythn-mua.org.", "idna"), "pyth\xf6n.org.")
|
||||
self.assertEqual(str(b"XN--pythn-mua.org.", "idna"), "pyth\xf6n.org.")
|
||||
self.assertEqual(str(b"xN--pythn-mua.org.", "idna"), "pyth\xf6n.org.")
|
||||
self.assertEqual(str(b"Xn--pythn-mua.org.", "idna"), "pyth\xf6n.org.")
|
||||
self.assertEqual(str(b"bugs.xn--pythn-mua.org.", "idna"),
|
||||
"bugs.pyth\xf6n.org.")
|
||||
self.assertEqual(str(b"bugs.XN--pythn-mua.org.", "idna"),
|
||||
"bugs.pyth\xf6n.org.")
|
||||
|
||||
def test_builtin_encode(self):
|
||||
self.assertEqual("python.org".encode("idna"), b"python.org")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue