Re: [whatwg/url] IDNA2008/UTS46 (#263)

IDNA2008
```
>>> import idna
>>> host = b'\xe2\x98\x83'
>>> idna.encode(host.decode('utf-8'), uts46=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/nlevitt/workspace/urlcanon/urlcanon-ve35/lib/python3.5/site-packages/idna/core.py", line 355, in encode
    result.append(alabel(label))
  File "/Users/nlevitt/workspace/urlcanon/urlcanon-ve35/lib/python3.5/site-packages/idna/core.py", line 276, in alabel
    check_label(label)
  File "/Users/nlevitt/workspace/urlcanon/urlcanon-ve35/lib/python3.5/site-packages/idna/core.py", line 253, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+2603 at position 1 of '☃' not allowed
```

IDNA2003
```
>>> host = b'\xe2\x98\x83'
>>> host.decode('utf-8').encode('idna')
b'xn--n3h'
```

-- 
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/url/issues/263#issuecomment-284055061

Received on Saturday, 4 March 2017 10:09:30 UTC