anchor.diff:  encode_string(S) -> [$",add_string(S, $"), $"].
   encode_atom(X)   -> [$',add_string(atom_to_list(X), $'), $'].
   encode_binary(X) -> [integer_to_list(size(X)), $~,X,$~].
  -    
  +
   do_encode(X, Dict) when is_atom(X); is_integer(X); is_binary(X) ->
       case dict:find(X, Dict) of
       {ok, Y} ->
  
positive.code: %%% Adapted for binary strings and data by Marc Worrell
  
  %%% Copyright 2002-2003 Joe Armstrong.
  %%% Copyright 2013 Marc Worrell. 
  %%%
  %%% All rights reserved.
  %%%
  
negative.code:     {more, fun(I) -> decode1(I, Stack, Dict, MaxSize) end};
  decode(X, _Stack, _Dict, _MaxSize) ->
      {error, {eof, X}}.
  
  get_stuff(<<$\\,H,T/binary>>, Stop, L, Stack, Dict, MaxSize) ->
      get_stuff(T, Stop, <<L/binary,H>>, Stack, Dict, MaxSize);
  get_stuff(<<$',T/binary>>, $', L, Stack, Dict, MaxSize)  ->
      Atom = list_to_existing_atom(z_convert:to_list(L)),
      decode1(T, push(Atom,Stack), Dict, MaxSize - erts_debug:flat_size(Atom));
  get_stuff(<<$",T/binary>>, $", L, Stack, Dict, MaxSize)  ->
      decode1(T, push(L,Stack), Dict, MaxSize - erts_debug:flat_size(L));
  get_stuff(<<$`,T/binary>>, $`, L, [[H|Tail]|Stack] = TS, Dict, MaxSize)  ->
      case L of
  