Closed youthy closed 7 years ago
In my environment, jsone(v1.4.3) produced the following result:
#
# Erlang Shell
#
> jsone:encode(#{<<"key">> => <<"aaaa/bbbb">>}).
<<"{\"key\":\"aaaa\\/bbbb\"}">>.
> file:write_file("/tmp/temp.json", jsone:encode(#{<<"key">> => <<"aaaa/bbbb">>})).
ok
#
# Bash
#
$ cat /tmp/temp.json
{"key":"aaaa\/bbbb"}
Indeed, it is differ from the jiffy/jsx behaviour.
But the above result (i.e., "aaaa\/bbbb") is also a valid JSON string.
Therefore, I do not know what you want to point out ...
(jsone
does not aim to be completely compatible with other JSON libraries.)
If there are any actual problems, it will be helpful if you let me know it.
ehhhh... I thought "xxx:\/xxxx\/xxxx.xx" maybe not a right url. But It can be read as url. I was wrong.~~~
Thanks for your reply. I'm glad you have no problem.
jsone:encode(#{<<"key">> => <<"aaaa/bbbb">>}) => <<"{\"key\":\"aaaa\/bbbb\"}">> jsx/jiffy:encode(#{<<"key">> => <<"aaaa/bbbb">>}) =><<"{\"key\":\"aaaa/bbbb\"}">>
when I use file:write_file, jsone result will be {"key":"aaaa\/bbbb"} others are right