Skip to content

Different behavior in parsing JSON string contains control character #2287

Closed
@PHILO-HE

Description

I found when JSON string contains control character, like \n, simdjson will raise UNESCAPED_CHARS error, which is different from some other JSON parsers that allow such characters. Simdjson expects literal control characters are used. For example, literal new line character (represented by \\n) is allowed. The below code decides this behavior:

if (buf[idx] < 0x20) { error = UNESCAPED_CHARS; }
.

Is it an expected behavior to simdjson user? And do we need to allow those characters in some way? E.g., let it depend on user's build option.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions