From 0607024eaf1f20f637b5aca433142aed04093d77 Mon Sep 17 00:00:00 2001 From: cgohlke Date: Sat, 24 Sep 2011 15:54:21 -0700 Subject: [PATCH] Fix UnicodeDecodeError: 'ascii' codec can't decode byte --- lib/matplotlib/cbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index c3d8ff596394..cbf6461be565 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -1820,7 +1820,7 @@ def __call__(self, key): def is_math_text(s): # Did we find an even number of non-escaped dollar signs? # If so, treat is as math text. - s = unicode(s) + s = unicode(s, 'windows-1252') dollar_count = s.count(r'$') - s.count(r'\$') even_dollars = (dollar_count > 0 and dollar_count % 2 == 0)