Update lib/matplotlib/backends/backend_cairo.py #1687

Merged
merged 1 commit into from Feb 18, 2013

4 participants

@burrbull

python version control in _draw_mathtext as in draw_text

@dmcdougall
Matplotlib Developers member

Thanks for your time to create a PR, @burrbull. I have one question, is there anything wrong with encoding unicode in python 3.x? Since strings are unicode by default in python 3.x, isn't s.encode("utf-8") a no-op?

@mdboom
Matplotlib Developers member

s.encode('utf-8') converts a Unicode string to a byte string (encoded in utf-8). My understanding is that Cairo on Python 2.x expects a utf-8-encoded byte string to be passed to it, whereas under Python 3.x it expects an actual Unicode string. So this fix makes sense to me.

@efiring efiring merged commit cb419a9 into matplotlib:master Feb 18, 2013

1 check was pending

Details default The Travis build is in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment