Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
Actually the utf8 is unnecessary for this case:
%mochijson2
mochijson2:encode({struct, [{"foo", foovalue}, {"bar", 3.2}]}).
% string result => {"foo":"foovalue","bar":3.2}
mochijson2:encode({struct, [{"foo", "foovalue"}, {"bar", 3.2}]}).
% string result => {"foo":[102,111,111,118,97,108,117,101],"bar":3.2}
%mochijson
mochijson:encode({struct, [{"foo", foovalue}, {"bar", 3.2}]}).
mochijson:encode({struct, [{"foo", "foovalue"}, {"bar", 3.2}]}).
% string result => {"foo":"foovalue","bar":3.2}
Original comment by john.m.b...@gmail.com
on 1 Feb 2009 at 6:34
mochijson2 has a different API than mochijson, which is why it's a separate
module. This is expected behavior,
JSON strings in mochijson2 MUST be represented as binary, because there is no
way to distinguish lists of
integers and erlang strings (because erlang strings are just syntax sugar for
lists of integers).
Original comment by bob.ippo...@gmail.com
on 1 Feb 2009 at 6:39
@Bob
Thank you, sorry for the false alarm!
Original comment by john.m.b...@gmail.com
on 1 Feb 2009 at 3:16
Original issue reported on code.google.com by
john.m.b...@gmail.com
on 1 Feb 2009 at 6:31