anchor.diff:                     [$r, $\\ | Acc];
                  $\t ->
                      [$t, $\\ | Acc];
  -               C when C >= 0, C < $\s; C >= 16#7f, C =< 16#10FFFF ->
  +               C when C >= 0, C < $\s ->
  +                   [unihex(C) | Acc];
  +               C when C >= 16#7f, C =< 16#10FFFF, State#encoder.utf8 ->
  +                   [xmerl_ucs:to_utf8(C) | Acc];
  +               C when  C >= 16#7f, C =< 16#10FFFF, not State#encoder.utf8 ->
                      [unihex(C) | Acc];
                  C when C < 16#7f ->
                      [C | Acc];
                  _ ->
                      exit({json_encode, {bad_char, C}})
              end,
  -    json_encode_string_unicode(Cs, Acc1).
  +    json_encode_string_unicode(Cs, State, Acc1).
   
   hexdigit(C) when C >= 0, C =< 9 ->
       C + $0;
  
positive.code:             false
      end.
  
  json_encode_string_unicode([], Acc) ->
      lists:reverse([$\" | Acc]);
  json_encode_string_unicode([C | Cs], Acc) ->
      Acc1 = case C of
                 ?Q ->
                     [?Q, $\\ | Acc];
  
negative.code:     [$, | Acc1] = lists:foldl(F, "{", Props),
      lists:reverse([$\} | Acc1]).
  
  json_encode_string(A, State) when is_atom(A) ->
      L = atom_to_list(A),
      case json_string_is_safe(L) of
          true ->
              [?Q, L, ?Q];
          false ->
              json_encode_string_unicode(xmerl_ucs:from_utf8(L), State, [?Q])
      end;
  json_encode_string(B, State) when is_binary(B) ->
      case json_bin_is_safe(B) of
          true ->
              [?Q, B, ?Q];
          false ->
              json_encode_string_unicode(xmerl_ucs:from_utf8(B), State, [?Q])
      end;
  json_encode_string(I, _State) when is_integer(I) ->
      [?Q, integer_to_list(I), ?Q];
  json_encode_string(L, State) when is_list(L) ->
      case json_string_is_safe(L) of
          true ->
              [?Q, L, ?Q];
          false ->
              json_encode_string_unicode(L, State, [?Q])
      end.
  
  json_string_is_safe([]) ->
  