fromJSON , toJSON does not escape \\ the same way
Reported by Clement DAVID (@davidcl)
BUG DESCRIPTION:
----------------
Reading and writing JSON files does not escape \\ in a similar way. Content written using toJSON might fail to parse using fromJSON.
ERROR LOG:
----------
fromJSON: JSON format expected.
HOW TO REPRODUCE THE BUG:
-------------------------
str = toJSON(struct("foo", "\"))
fromJSON(str) // works !!!
str = toJSON(struct("foo", "\\"))
fromJSON(str) // failed
OTHER INFORMATION:
------------------
--> toJSON(struct("foo", "\"))
ans =
"{"foo": "\\"}"
--> toJSON(struct("foo", "\\"))
ans =
"{"foo": "\\\"}"