Open GoogleCodeExporter opened 9 years ago
`null` is usually parsed in as zero, not as an empty string (depends on the
plugin author obviously; I use zero, same does NeoVim for msgpack Nil).
tojson/fromjson names break usual naming: it is mostly either get/set{smth}
(getline/setline, etc) or {smth}{action} (foldopen, foldclose, …), so
jsondump/parse are better. To dump/parse null, true, false unambigiously I
propose a second argument: a dictionary looking like
:let specialsdict = {'null': {}, 'true': {}, 'false': {}}
:echo jsonparse("true", specialsdict) is# specialdicts.true
1
:echo jsondump([specialsdict.null, {}, 0, ''], specialsdict)
[null, {}, 0, ""]
Note that 99% of JSON you may parse with eval like in VAM (it has a regex that
verifies that parsing is safe). But you don’t get normal errors in this case.
It also does not work with surrogate pairs.
Original comment by zyx....@gmail.com
on 14 Jul 2015 at 5:28
Original issue reported on code.google.com by
daviebd...@gmail.com
on 13 Jul 2015 at 11:30