-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Specify charset=UTF-8
when serving non-base64 files
#2402
Conversation
This handles the fallback case where we don't find a mimetype for a file. Do we also want to do the same if |
@takluyver does mimetype return the charset for a file? I wouldn't think it would, but for text/plain sending charset=utf-8 wouldn't be that bad of a guess in most cases. When you have a .txt file and click on it in the browser, you open up an editor that correctly shows the contents as a UTF-8, it is only when you download the raw file at the moment, for example when you rename a file with UTF-8 characters within it to |
@takluyver It sounds like a good idea to me. Does that look right? |
Thanks, that looks good. There's a test failure, though, because we have a test that expects
I don't think mimetype - or anything in the standard library - does encoding detection. |
Ok, tests are passing! Let's wait to see if these resolves #2397 before merging... |
This resolves the issue for me and log files are now downloaded correctly. |
Closes #2397