In the LaTeX log, characters appearing in the TeX input are represented using the fontenc. This can ultimately lead to a UnicodeDecodeError as in the following minimal example:
from pyx import canvas, text
text.set(text.LatexRunner, texenc="utf-8")
text.preamble(r"""\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}""")
c = canvas.canvas()
c.text(0, 0, r'foo föo föo f\"oo f\"oo', [text.parbox(2)])
c.writePDFfile()
In the LaTeX log, the umlaut ö will be represented as byte 0xf6 which cannot be interpreted as UTF-8 encoded character. The problem arises independently of whether the umlaut in the input is given in UTF-8 or in TeX code (\"o).
In the LaTeX log, characters appearing in the TeX input are represented using the
fontenc
. This can ultimately lead to aUnicodeDecodeError
as in the following minimal example:In the LaTeX log, the umlaut
ö
will be represented as byte0xf6
which cannot be interpreted as UTF-8 encoded character. The problem arises independently of whether the umlaut in the input is given in UTF-8 or in TeX code (\"o
).