Skip to content

Parse files with byte-order-mark #54

@am11

Description

@am11

When parsing a JSON file with BOM such as:

https://github.com/dotnet/toolset/blob/40cc5860e2ef311b9aca733b1d2eccaa681bd422/TestAssets/InstallationScriptTests/InstallationScriptTests.json

JSON.sh gives the following error:

EXPECTED EOF GOT {

Current workaround is to strip these characters using tool like awk: awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}1' "$json_file" | sh JSON.sh | .....

It would be nice if parser skip these BOM characters and start parsing after the offset. It will save consumers from stripping these characters.

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