-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Does not render UTF-8 correctly #209
Comments
The problem is in the implementation of actix_web. Try that template in this example, https://github.com/djc/askama/blob/master/testing/tests/actix_web.rs, and recomment, please. |
I'm skeptical that Askama is the problem here, since it has tests to make sure it handles UTF-8 correctly (though not specifically the Actix-Web test). Also, I don't know what your |
Here's a quick example:
|
That doesn't actually show any string contents... |
The test passed, but the issue is how Firefox interprets the content type. It has to be Default behavior with askama is to only show text/html. It looks like this is because of mime_guess - askama uses its output to override actix_web's default, but mime_guess doesn't include a charset:
Looks like mime_guess is possible of providing a charset with the mime_type from a cursory look at the API: I'm guessing this doesn't happen here due to it only having the extension and not the file content? But in this case I think askama templates are explicitly UTF-8, so you could probably add it. It looks like regardless you can work around this by setting a |
Providing mime_guess with UTF-8 charset sounds about right, can you do a PR? |
Closing, as it was fixed in #219. |
This template:
results in:
Even trying to explicitly set the charset to UTF-8 fails:
The text was updated successfully, but these errors were encountered: