benoitc / erlang-idna

Erlang IDNA lib
MIT License
43 stars 29 forks source link

Codepoint not allowed: Emoji domains are not working #35

Closed ruudk closed 1 year ago

ruudk commented 4 years ago

I'm not able to convert emoji domains like:

:idna.encode("πŸ‘πŸ‘„πŸ‘.fm")
** (exit) {:bad_label, {:context, 'Codepoint 128065 not allowed (\'DISALLOWED\') at posion 0 in [128065,128068,\n                                                            128065]'}}

# Expecting 'xn--mp8hai.fm'`

While this works:

:idna.encode("ΓΌber.de")
'xn--ber-goa.de'

Am I doing something wrong here or is this not supported?

benoitc commented 4 years ago

hrm it works there :

3> idna:encode("ΓΌber.de") 3> . "xn--ber-goa.de"

is your shell unicode?

ruudk commented 4 years ago

Yes, the example with Uber works fine. But the one with Emoji's doesn't.

I'm using iTerm2 on macOS and that has support for unicode.

ruudk commented 4 years ago

Try this:

:idna.encode("πŸ‘πŸ‘„πŸ‘.fm")
benoitc commented 4 years ago

i'm not sure that code point (128065) is indeed disallowed in table 11. Maybe updating the table would work. I didn't check it yet.

ruudk commented 4 years ago

I'm new to Erlang (only using Elixir atm) so I have no idea how to update the table. Are the instructions somewhere in this repository?

ruudk commented 4 years ago

@benoitc if you have any tips how to proceed that would be much appreciated. I can submit a PR once I'm able to update the data.

ruudk commented 4 years ago

@benoitc Handled in #36 What do you think? :)