anchor.diff:              ?ACE_PREFIX ++ punycode:encode(Label)
       end.
   
  -from_ascii([], Acc) ->
  -    lists:reverse(Acc);
  -from_ascii([Label|Labels], []) ->
  -    from_ascii(Labels, lists:reverse(label_from_ascii(Label)));
  -from_ascii([Label|Labels], Acc) ->
  -    from_ascii(Labels, lists:reverse(label_from_ascii(Label), [$.|Acc])).
  -
  -label_from_ascii(?ACE_PREFIX ++ Label) ->
  -    punycode:decode(Label);
  -label_from_ascii(Label) ->
  +decode_1([], Acc) ->
  +    list:reverse(Acc);
  +decode_1([Label|Labels], []) ->
  +    decode_1(Labels, lists:reverse(ulabel(Label)));
  +decode_1([Label|Labels], Acc) ->
  +    decode_1(Labels, lists:reverse(ulabel(Label), [$.|Acc])).
  +
  +ulabel(?ACE_PREFIX ++ Label0) ->
  +    Label = punycode:decode(Label0),
  +    ok = check_label(Label),
  +    Label;
  +ulabel(Label) ->
  +    ok = check_label(Label),
       Label.
   
   
  
positive.code:       ok
    end.
  
  
  
  check_label(Label) ->
    ok = check_nfc(Label),
    ok = check_hyphen(Label),
  
negative.code: -module(idna).
  
  %% API
  -export([encode/1, encode/2,
           decode/1, decode/2]).
  
  %% compatibility API
  -export([to_ascii/1,
  