benoitc / erlang-idna

Erlang IDNA lib
MIT License
43 stars 29 forks source link

Error while trying to decode seemingly valid domain name #38

Open wantedru opened 3 years ago

wantedru commented 3 years ago

Domain name "xn--p5b2bfp5fh3fra.xn--45brj9c" seems valid, at least it's been succesfully decoded by chrome and various online punycode converters to "কোম্পানি.ভারত". But in elixir I receive the following error:

iex> :idna.decode('xn--p5b2bfp5fh3fra.xn--45brj9c')                   
** (exit) {:bad_label, {:nfc, 'Label must be in Normalization Form C'}}
    (idna 6.1.1) /deps/idna/src/idna.erl:157: :idna.check_nfc/1
    (idna 6.1.1) /deps/idna/src/idna.erl:255: :idna.check_label/4
    (idna 6.1.1) /deps/idna/src/idna.erl:313: :idna.ulabel/1
    (idna 6.1.1) /deps/idna/src/idna.erl:296: :idna.decode_1/2
benoitc commented 8 months ago

probably we shoudl handle the latest update of the specification.