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

Naïve coercion of file encodings causes mojibake #5

Open
ctrlcctrlv opened this issue Mar 31, 2021 · 0 comments
Open

Naïve coercion of file encodings causes mojibake #5

ctrlcctrlv opened this issue Mar 31, 2021 · 0 comments

Comments

@ctrlcctrlv
Copy link

Given your work on 2channel, this error is particularly naïve.

HTML -> setContentType "text/html; charset=utf-8"

The code is written such that any file ending with .html will be returned with the charset utf-8.

Obviously this will not work for SJIS files. Encodings cannot be guessed like this. That's why the <meta charset> exists, and should be used instead. Trying to coerce the encoding will cause browsers to disable their encoding detection, and cause mojibake.

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

No branches or pull requests

1 participant