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

Reading File with UTF-8 BOM produce Syntax Error #381

Closed
aersam opened this issue Feb 16, 2023 · 4 comments · Fixed by #385
Closed

Reading File with UTF-8 BOM produce Syntax Error #381

aersam opened this issue Feb 16, 2023 · 4 comments · Fixed by #385
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@aersam
Copy link

aersam commented Feb 16, 2023

Describe the bug
When calling sqlfmt on a file starting the famous UTF-8 BOM, it produces an error:

 sqlfmt encountered an error: Could not parse SQL at position 1: '»¿SELECT

Expected behavior
Well, it should just read that file. And also emit in UTF-8-BOM if easily possible

Additional context
What is the output of sqlfmt --version?
sqlfmt, version 0.16.0

@tconbeer tconbeer added bug Something isn't working help wanted Extra attention is needed labels Feb 17, 2023
@tconbeer
Copy link
Owner

Thanks for the report, @aersam. We've been punting on supporting other encodings (and I'll include windows-flavored utf-8 in that), but it's probably about time to fix that.

@tconbeer
Copy link
Owner

See also #350

@aersam
Copy link
Author

aersam commented Feb 24, 2023

Thanks a lot! Looks like something python should have built-in if you ask me

@tconbeer
Copy link
Owner

Yeah, the file munging stuff is frustratingly hard to get right, especially across OSes.

This fix has been released in v0.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants