Issue #1215 invalid

UnicodeDecodeError when creating man pages from utf-8 encoded file

Stanislav Heller
created an issue

If I try to build man page with sphinx-build -b man from rst file with non-ascii characters (czech language) in title encoded in utf-8 (from file -bi i am getting output text/plain; charset=utf-8), I am getting this error:

# Sphinx version: 1.2b1
# Python version: 2.7.3
# Docutils version: 0.10 release
# Jinja2 version: 2.7
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/sphinx/", line 247, in main, filenames)
  File "/usr/local/lib/python2.7/dist-packages/sphinx/", line 211, in build
  File "/usr/local/lib/python2.7/dist-packages/sphinx/builders/", line 206, in build_update['__all__'], to_build)
  File "/usr/local/lib/python2.7/dist-packages/sphinx/builders/", line 267, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/local/lib/python2.7/dist-packages/sphinx/builders/", line 88, in write
    docwriter.write(largetree, destination)
  File "/usr/local/lib/python2.7/dist-packages/docutils/writers/", line 80, in write
  File "/usr/local/lib/python2.7/dist-packages/sphinx/writers/", line 36, in translate
    self.output = visitor.astext()
  File "/usr/local/lib/python2.7/dist-packages/docutils/writers/", line 256, in astext
  File "/usr/local/lib/python2.7/dist-packages/sphinx/writers/", line 86, in header
    return tmpl % self._docinfo
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128)

In, i have source_encoding = 'utf-8-sig', have tried both 'utf-8' and 'utf8', nothing works for me.

Comments (5)

  1. Stanislav Heller reporter

    Sorry, while preparing file for reproducing this error, i found that it was my fault. There were non-unicode strings inserted into the man_pages variable in I have read the notice about Unicode in in documentation, but forgot about some hacks i made in my

    Now its working fine, no error occurs. Nevermind, thanks a lot for your time + all my apologies.

  2. Log in to comment