Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: backend_pdf: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 #3076

Merged
merged 1 commit into from May 19, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/matplotlib/backends/backend_pdf.py
Expand Up @@ -1822,7 +1822,8 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
oldfont = dvifont
# We need to convert the glyph numbers to bytes, and the easiest
# way to do this on both Python 2 and 3 is .encode('latin-1')
seq += [['text', x1, y1, [chr(glyph).encode('latin-1')], x1+width]]
seq += [['text', x1, y1,
[six.unichr(glyph).encode('latin-1')], x1+width]]

# Find consecutive text strings with constant y coordinate and
# combine into a sequence of strings and kerns, or just one
Expand Down