7DRPbUVVLH3AWxKIsUOx84 changeset

Changeset313531383336 (b)
ParentNone (a)
ab
0+diff --git a/src/mochiweb/mochijson2.erl b/src/mochiweb/mochijson2.erl
0+index bdf6d77..c1c2be6 100644
0+--- a/src/mochiweb/mochijson2.erl
0++++ b/src/mochiweb/mochijson2.erl
0+@@ -172,28 +172,31 @@ json_encode_proplist(Props, State) ->
0+ 
0+ json_encode_string(A, State) when is_atom(A) ->
0+     L = atom_to_list(A),
0+-    case json_string_is_safe(L) of
0+-        true ->
0+-            [?Q, L, ?Q];
0+-        false ->
0+-            json_encode_string_unicode(xmerl_ucs:from_utf8(L), State, [?Q])
0+-    end;
0++    [?Q, L, ?Q];
0++    %% case json_string_is_safe(L) of
0++    %%     true ->
0++    %%         [?Q, L, ?Q];
0++    %%     false ->
0++    %%         json_encode_string_unicode(xmerl_ucs:from_utf8(L), State, [?Q])
0++    %% end;
0+ json_encode_string(B, State) when is_binary(B) ->
0+-    case json_bin_is_safe(B) of
0+-        true ->
0+-            [?Q, B, ?Q];
0+-        false ->
0+-            json_encode_string_unicode(xmerl_ucs:from_utf8(B), State, [?Q])
0+-    end;
0++    [?Q, B, ?Q];
0++    %% case json_bin_is_safe(B) of
0++    %%     true ->
0++    %%         [?Q, B, ?Q];
0++    %%     false ->
0++    %%         json_encode_string_unicode(xmerl_ucs:from_utf8(B), State, [?Q])
0++    %% end;
0+ json_encode_string(I, _State) when is_integer(I) ->
0+     [?Q, integer_to_list(I), ?Q];
0+ json_encode_string(L, State) when is_list(L) ->
0+-    case json_string_is_safe(L) of
0+-        true ->
0+-            [?Q, L, ?Q];
0+-        false ->
0+-            json_encode_string_unicode(L, State, [?Q])
0+-    end.
0++    [?Q, L, ?Q].
0++    %% case json_string_is_safe(L) of
0++    %%     true ->
0++    %%         [?Q, L, ?Q];
0++    %%     false ->
0++    %%         json_encode_string_unicode(L, State, [?Q])
0++    %% end.
0+ 
0+ json_string_is_safe([]) ->
0+     true;
...
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
55
56
57
--- Revision None
+++ Revision 313531383336
@@ -0,0 +1,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;