Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

output a string instead of a binary

  • Loading branch information...
commit 9a2d1f3fcad72298b6dc64d6651b22e030df2706 1 parent 18dbbc5
Chris Anderson authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 json_eep.erl
View
7 json_eep.erl
@@ -42,9 +42,10 @@ term_to_json(T) ->
S = json_encode(T),
case is_list(S) of
true ->
- list_to_binary(S);
+ % I don't know why this helps
+ binary_to_list(list_to_binary(S));
false ->
- S
+ binary_to_list(S)
end.
json_to_term(S) ->
@@ -240,7 +241,7 @@ test_next([{E,J}|Rest]) ->
Term = json_to_term(J),
?LOG("Decoded ~p~n", [Term]),
true = equiv(E, Term),
- Json = binary_to_list(term_to_json(Term)),
+ Json = term_to_json(Term),
?LOG("Encoded ~s~n~n", [Json]),
true = equiv(Term, json_to_term(Json)),
test_next(Rest).
Please sign in to comment.
Something went wrong with that request. Please try again.