axiros / terminal_markdown_viewer

Styled Terminal Markdown Viewer
Other
1.8k stars 105 forks source link

set the encoding of open explicitly #90

Closed liudonghua123 closed 3 years ago

liudonghua123 commented 3 years ago

According to https://stackoverflow.com/questions/42070668/python-3-default-encoding-cp1252, https://stackoverflow.com/questions/49991870/python-default-string-encoding and so on, it's strongly recommended to use open(filename, encoding='utf-8') to read a file.

axgkl commented 3 years ago

you are right, I add it, but with a switch for py2. will push later today.