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:      {[-123, <<"foo">>, obj_from_list([{<<"bar">>, []}]), null],
        "[-123,\"foo\",{\"bar\":[]},null]"}
      ].
  
negative.code:             false
      end.
  
  json_encode_string_unicode([], _State, Acc) ->
      lists:reverse([$\" | Acc]);
  json_encode_string_unicode([C | Cs], State, Acc) ->
      Acc1 = case C of
                 ?Q ->
                     [?Q, $\\ | Acc];
  