diff --git a/src/mochiweb/mochijson2.erl b/src/mochiweb/mochijson2.erl index bdf6d77..c1c2be6 100644 --- a/src/mochiweb/mochijson2.erl +++ b/src/mochiweb/mochijson2.erl @@ -172,28 +172,31 @@ json_encode_proplist(Props, State) -> 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; + [?Q, L, ?Q]; + %% 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; + [?Q, B, ?Q]; + %% 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. + [?Q, L, ?Q]. + %% case json_string_is_safe(L) of + %% true -> + %% [?Q, L, ?Q]; + %% false -> + %% json_encode_string_unicode(L, State, [?Q]) + %% end. json_string_is_safe([]) -> true;