jsown icon indicating copy to clipboard operation
jsown copied to clipboard

carriage return character causes json misparse

Open psilord opened this issue 5 years ago • 0 comments

Hello,

A literal ^M character in a string will cause jsown to misparse numbers.

In the code below I wrote ^M as explicitly two characters where you could see it, otherwise the github markup system interpreted it as a carriage return.

CL-USER> (jsown:val-safe (jsown:parse "{ \"weights\" : [ 0.5, 0.5^M ] }") "weights")
(1/2 1/20)

I worked around it by stripping all \r and \n characters from my strings before parsing them, but I figured you'd want to know.

Thank you.

psilord avatar Dec 07 '19 20:12 psilord