Skip to content

Fix issue reading files with Byte Order Mark#419

Open
dylandhall wants to merge 2 commits into
antonmedv:masterfrom
dylandhall:master
Open

Fix issue reading files with Byte Order Mark#419
dylandhall wants to merge 2 commits into
antonmedv:masterfrom
dylandhall:master

Conversation

@dylandhall

Copy link
Copy Markdown

This intercepts the io.Reader in the method to open a json file, reads the first 3 bytes, and if the first 3 bytes are the BOM in a file it skips over them. If they are not it returns a copy of the reader with the original 3 bytes inserted back in.

Would fix issue #418

I am not primarily a go dev so please confirm this is a good approach with no performance implications or anything, it works fine on my machine in testing however.

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

Successfully merging this pull request may close these issues.

1 participant