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)