Encoding error when loading notebook written in markdown in Jupyter
Hi,
I've created a markdown document jose.md containing some accented characters like:
## Sobre mí
José de España.
When I tried to load it in Jupyter after activating markdown format by using this:
printf "c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'" >> ~/.jupyter/jupyter_notebook_config.py
I get an encoding error:
Unreadable Notebook: /home/researcher/wwc/_friends/jose.md UnicodeDecodeError('ascii', b'---\ntitle: Jos\xc3\xa9\n---\n\n## Sobre m\xc3\xad\n\nJos\xc3\xa9 de Espa\xc3\xb1\n', 14, 15, 'ordinal not in range(128)')
However, I've I try to create a new notebook within Jupyter, and I add the same text in a markdown cell does not happing anything.
I get a similar error when trying to add accented characters in an already existing and running markdown notebook, if I try to save.
Unexpected error while saving file: wwc/_friends/jose5.md 'ascii' codec can't encode character '\xe9' In position 218: ordinal not in range(128)
I think it is something that has to do with notedown. Since I can add UTF-8 characters in markdown cells in native jupyter notebooks. And run/load/save without any issue.
Any hints?
I can reproduce this with your input and python 2. Should be able to fix.
I think I've fixed the read case: can you see if the latest master fixes your problem?
I was unable to reproduce the write case (putting accented characters in a markdown cell and saving). Can you tell me some more about your environment - python / jupyter versions, notedown version (latest master?) - and also give an explicit set of steps to reproduce the problem?
Hi @aaren The master fixes the read case. Regarding the write case, it fails in both markdown and code cells.
My environment:
- OS: CentOS Linux 7 (Core)
- Python: Python 3.4.3
- Jupyter: 1.0.0
- notedown: 1.5.0 (and also the master version)
Take an already existing notebook in markdown format and write in a code cell something like:
name = 'José'
And then try to save. It should yield an error.
Say that the cell is a markdown one:
# Sobre José
Soy José de España
And try to save.
In both cases you should get an error at saving.