anchor.diff:  -module('utf8').
   
   %% API exports
  --export([encode/1]).
  +-export([encode/1, decode/1]).
   
   %%====================================================================
   %% API functions
  
positive.code:       2#10:2,   Middle:6,
        2#10:2,   Lower:6
      >>;
  % Encode SMP characters.
  encode_char(CodePoint) when 16#010000 =< CodePoint, CodePoint =< 16#10FFFF ->
      <<0:11, Upper:3, Two:6, Three:6, Four:6>> = <<CodePoint:32/big>>,
      <<
  
negative.code: 
  -type code_point() :: 0..16#10FFFF.
  
  -spec encode([code_point()]) -> binary().
  encode(List) ->
      iolist_to_binary([encode_char(CP) || CP <- List]).
  
  -spec decode(binary()) -> [code_point()].
  decode(Binary) ->
      lists:reverse(decode(Binary, [])).
  
  %%====================================================================
  %% Internal functions
  %%====================================================================
  
  % Encode ASCII
  encode_char(CodePoint) when 16#0000 =< CodePoint, CodePoint =< 16#007F ->
      <<CodePoint>>;
  % Encode two byte forms.
  encode_char(CodePoint) when 16#0080 =< CodePoint, CodePoint =< 16#07FF ->
      <<0:5, Upper:5, Lower:6>> = <<CodePoint:16/big>>,
      <<
  