Skip to content

Crack::JSON can't parse valid json string with UTF-8 character #52

@bblimke

Description

@bblimke

Parsing the following json "{"data":"{\"foo\":\"\u0026\""}""` raises "Crack::ParseError".

i.e.

require 'json'
require 'crack'

json = JSON.generate({"data"=>"{\"foo\":\"\\u0026\""})

JSON.parse(json)

Crack::JSON.parse(json)

> `rescue in parse': Invalid JSON string (Crack::ParseError)

This seems to be a problem with Psych not being able to handle well \u0026 character.

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