8000 Merge pull request #19 from NelleV/tacaswell_fix_nonascii_afm · matplotlib/matplotlib@9278668 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9278668

Browse files
authored
Merge pull request #19 from NelleV/tacaswell_fix_nonascii_afm
TST afm._to_str is now tested against utf8-encoded bytes
2 parents ce92859 + 343f5fc commit 9278668

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/tests/test_afm.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import matplotlib.afm as afm
2+
import six
3+
4+
5+
def test_nonascii_str():
6+
# This tests that we also decode bytes as utf-8 properly.
7+
# Else, font files with non ascii caracters fail to load.
8+
9+
if six.PY3:
10+
string = "привет".encode("utf8")
11+
else:
12+
string = "привет"
13+
afm._to_str(string)

0 commit comments

Comments
 (0)
0