When converting utf-8 encoded text to html using markdown2.py
, the result is ASCII encoded. How can I tell markdown2 to render utf-8?
Sample input file called ff.md
:
Hallo, Bjørn Nößflögl
transformed using:
C:\Python37\python.exe C:\Python37\Scripts\markdown2.py ff.md
When I open the result in an editor (Notepad++), it thinks it's ASCII. Likewise when I render it using flask
's render_template
it crashes on the diacritics. (UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 12: invalid start byte
)
If I manually convert to utf-8 with Notepad++, everything's fine.
Glancing briefly over the markdown2 code, I can see input when read is assumed to be utf-8. So I don't understand why it's not rendered as such.