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

Recognize & skip the UTF-8 BOM #3216

Merged
merged 1 commit into from
Sep 11, 2019
Merged

Recognize & skip the UTF-8 BOM #3216

merged 1 commit into from
Sep 11, 2019

Conversation

LemonBoy
Copy link
Contributor

I was puzzled when a file downloaded from Godbolt kept telling me there were extraneous characters at the very beginning of the file.

@rohlem
Copy link
Contributor

rohlem commented Sep 11, 2019

Wouldn't this fall under the same "only one way to do things"-category as f.e. CRLF line endings?
In which case current compiler behaviour is to reject (though with a more helpful error message), and zig fmt fixes/standardizes the source file.
(see also PR #582 )

@LemonBoy
Copy link
Contributor Author

Wouldn't this fall under the same "only one way to do things"-category as f.e. CRLF line endings?

UTF-8 with BOM is still UTF-8

zig fmt fixes/standardizes the source file

zig fmt is able to read such files but doesn't preserve the BOM, the status quo is retained

@andrewrk andrewrk merged commit f36b8fd into ziglang:master Sep 11, 2019
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.

3 participants