Skip to content

carriage return character causes json misparse #26

Description

@psilord

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions