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
Special characters get encoded wrong with dbt templater #3729
Comments
I'm not sure SQLFluff can do much in this case, since dbt is reading the file when using the dbt templater. I'm curious, what operating system are you using? I heard about a similar problem recently from a Windows user, which they were able to fix somehow; I think it involved changing the character encoding in their Command Prompt. |
Oh, I didn't know that all the encoding was handled by dbt when using the dbt templater. Atleast that explains why it worked for I'm using Windows too. Tried what I interpreted was your suggestion I verified that the change actually took place in power shell, but still no difference in results. Do you happen to know where I could find this similar example? |
I think it was a discussion in Slack. Maybe try searching the Slack history. It may have been a GitHub issue, so you could also try searching for issues (closed as well as open ones) that mention "Windows". |
Is there a dbt setting that lets you control the encoding? |
I found the other issue/discussion: #3585 |
Thanks alot for your help @barrywhart ! Setting it to utf-8 globally as in the other issue worked for me as well. Is this something that I should report as a bug to dbt? I'm guessing it could be handled by them allowing to set the output encoding explicitly like sqlfluff is. |
It's probably worth raising it as a bug with them, especially if it causes issues other than with SQLFluff. I also wonder if this is something SQLFluff can check for, or at least document somewhere. You're the second person to report this issue, so it'd be great if the info were not "hidden"' in an old GitHub issue. |
Changing from |
In the dbt templater, we may want to use |
Search before asking
What Happened
When running
sqlfluff fix
the special characters "ÅÄÖ" becomes "ÅÄÖ". This happens when usingtemplater = dbt
and NOT when usingtemplater = jinja
.Expected Behaviour
For special characters to remain same, i.e. to respect encoding.
Observed Behaviour
Since it works for templater = jinja, I guess there's just some incomplete implementation for dbt.
How to reproduce
SQL-code (couldn't attach sql files): testing_special_characters
CLI-command
Dialect
snowflake
Version
Configuration
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
The text was updated successfully, but these errors were encountered: