pycco-docs / pycco

Literate-style documentation generator.

Home Page:https://pycco-docs.github.io/pycco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dump out docs in UTF-8 and not in locale.getpreferredencoding

fbuchinger opened this issue · comments

Currently, you try to determine the "preferred" encoding and write out the generated doc files in that encoding. This doesn't make sense since UTF-8 is the de-facto default encoding for the web. Under Windows 7 i get something like 'cp1252' (Codepage 1252) as preferred encoding --> the doc export crashed (probably because of some umlauts in the comments).

When I changed fh.write(html.encode(getpreferredencoding())) to fh.write(html.encode('utf-8')) everything went ok