-
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
Jupyter Notebook /files/ endpoint doesn't correctly send UTF-8 text files #2397
Comments
There's nothing wrong with |
Sending I would argue that sending Another option would be to check the |
@bertjwregeer I'm looking for where this change may need to happen. Does this look right? diff --git a/notebook/files/handlers.py b/notebook/files/handlers.py
index c54151125..be3197ce7 100644
--- a/notebook/files/handlers.py
+++ b/notebook/files/handlers.py
@@ -52,7 +52,7 @@ class FilesHandler(IPythonHandler):
if model['format'] == 'base64':
self.set_header('Content-Type', 'application/octet-stream')
else:
self.set_header('Content-Type', [-'text/plain')-]{+'text/plain; charset=UTF-8')+}
if include_body:
if model['format'] == 'base64': |
The diff format you used is not one I recognise, but yes, changing that header should work to change the default. |
@bertjwregeer Ya I'm using the git-plus Atom extension ¯_(ツ)_/¯ I submitted a PR, can you check it out and let me know if it resolves your issue?
|
@gnestor will pull it down and check it out, I'll get back to you :-). |
@bertjwregeer Any luck with this PR? |
I have been traveling, will verify later today. |
Sorry for the late reply. This fixes the issue for me :-) |
I have various log files that are generated by an outside process that are accessible by the Jupyter notebook. We would like users to be able to use these log files to verify that their actions are correct, however as soon as they click on them the file is downloaded as ASCII
text/plain
, which causes the fancy quotes to be replaced with:from:
‘text’
to
‘text’
Is there some way to force Jupyter to correctly identify files ending with
.log
as UTF-8 plain text files?The text was updated successfully, but these errors were encountered: