Revision 313531383336 () - Diff

Link to this snippet: https://friendpaste.com/7DRPbUVVLH3AWxKIsUOx84
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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;