benoitc / erlang-idna

Erlang IDNA lib
MIT License
43 stars 29 forks source link

Failing Emoji test #37

Closed ruudk closed 3 years ago

ruudk commented 4 years ago

PR is based on #36 - Needs rebase once merged.

See https://util.unicode.org/UnicodeJsps/idna.jsp?a=%F0%9F%91%81%F0%9F%91%84%F0%9F%91%81.fm

Converting πŸ‘πŸ‘„πŸ‘.fm using UTS46 should yield xn--mp8hai.fm but gives:


  1) uts46_emoji_test:uts46_encode_test/0
     Failure/Error: {exit,
                        {bad_label,
                            {context,
                                "Codepoint 128065 not allowed ('DISALLOWED') at position 0 in [128065,128068,\n                                                              128065]"}},
                        [{idna,check_context,4,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,209}]},
                         {idna,check_label,4,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,254}]},
                         {idna,alabel,1,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,283}]},
                         {idna,encode_1,2,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,145}]},
                         {uts46_emoji_test,'-uts46_encode_test/0-fun-0-',0,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/test/uts46_emoji_test.erl"},
                              {line,19}]},
                         {eunit_test,'-mf_wrapper/2-fun-0-',2,
                             [{file,"eunit_test.erl"},{line,273}]},
                         {eunit_test,run_testfun,1,
                             [{file,"eunit_test.erl"},{line,71}]},
                         {eunit_proc,run_test,1,
                             [{file,"eunit_proc.erl"},{line,522}]}]}
     Output:
  2) uts46_emoji_test:uts46_decode_test/0
     Failure/Error: {exit,
                        {bad_label,
                            {context,
                                "Codepoint 128065 not allowed ('DISALLOWED') at position 0 in [128065,128068,\n                                                              128065]"}},
                        [{idna,check_context,4,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,209}]},
                         {idna,check_label,4,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,254}]},
                         {idna,ulabel,1,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,309}]},
                         {idna,decode_1,2,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/src/idna.erl"},
                              {line,292}]},
                         {uts46_emoji_test,'-uts46_decode_test/0-fun-0-',0,
                             [{file,
                                  "/Users/Ruud/Downloads/erlang-idna/test/uts46_emoji_test.erl"},
                              {line,22}]},
                         {eunit_test,'-mf_wrapper/2-fun-0-',2,
                             [{file,"eunit_test.erl"},{line,273}]},
                         {eunit_test,run_testfun,1,
                             [{file,"eunit_test.erl"},{line,71}]},
                         {eunit_proc,run_test,1,
                             [{file,"eunit_proc.erl"},{line,522}]}]}
     Output:
ruudk commented 4 years ago

I don't get it. In the mapping file I see:

uts46_map(128065) -> 'V';

so that codepoint is valid.

benoitc commented 4 years ago

yes for uts46 it is valid but not idna2008

On Sun 8 Nov 2020 at 13:10 Ruud Kamphuis notifications@github.com wrote:

I don't get it. In the mapping file I see:

uts46_map(128065) -> 'V';

so that codepoint is valid.

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/benoitc/erlang-idna/pull/37#issuecomment-723568971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADRIXVQAJTSIYV7XVAOM3SO2DDNANCNFSM4TOHXXDA .

-- Sent from my Mobile

benoitc commented 3 years ago

?

ruudk commented 3 years ago

I closed it, I think you are right and that it's not supported. Since this library is about idna it doesn't make sense to support it?