anchor.diff:  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -%%% @doc Klarna Api Testing Tool.
  +%%% @doc Klarna API Testing Tool.
   %%%
   %%% Use for shooting requests against any kind of http interface
   %%% (e.g. json, xml) and verifying the response.
  
positive.code: to_utf8(X) when is_list(X) -> unicode:characters_to_binary(X, utf8);
  to_utf8(X)                 -> X.
  
  to_list(X) when is_list(X)    -> X;
  to_list(X) when is_atom(X)    -> atom_to_list(X);
  to_list(X) when is_tuple(X)   -> tuple_to_list(X);
  to_list(X) when is_binary(X)  -> binary_to_list(X);
  to_list(X) when is_integer(X) -> integer_to_list(X).
  
  %%%_* Emacs ============================================================
  %%% Local Variables:
  %%% allout-layout: t
  
negative.code: to_proplist(Value)                       ->
    Value.
  
  substitute(Bin, [])         -> Bin;
  substitute(Bin, [{K, V}|T]) -> substitute(substitute(Bin, K, V), T).
  
  substitute(Bin, K, V) ->
    re:replace(Bin, ?SUB_BEGIN_TAG ++ tulib_lists:to_list(K) ++ ?SUB_END_TAG,
               tulib_lists:to_list(V), [{return, binary}, global]).
  
  %% Replace "extract" tags with actual values
  replace_variables(Str) when is_list(Str) -> replace_variables(Str, []);
  