Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse files with byte-order-mark #54

Open
am11 opened this issue Dec 7, 2019 · 0 comments
Open

Parse files with byte-order-mark #54

am11 opened this issue Dec 7, 2019 · 0 comments

Comments

@am11
Copy link

am11 commented Dec 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant