Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f7aa5e

Browse files
committed
Merge pull request #3076 from mdboom/russian
Bug: backend_pdf: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2
2 parents 4af8e7d + a00196b commit 7f7aa5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,8 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
18221822
oldfont = dvifont
18231823
# We need to convert the glyph numbers to bytes, and the easiest
18241824
# way to do this on both Python 2 and 3 is .encode('latin-1')
1825-
seq += [['text', x1, y1, [chr(glyph).encode('latin-1')], x1+width]]
1825+
seq += [['text', x1, y1,
1826+
[six.unichr(glyph).encode('latin-1')], x1+width]]
18261827

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

0 commit comments

Comments
 (0)