Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Feb 18, 2013
Merged

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

merged 1 commit into from Feb 18, 2013

Conversation

burrbull
Copy link
Contributor

python version control in _draw_mathtext as in draw_text

@dmcdougall
Copy link
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
Copy link
Member

mdboom commented Jan 23, 2013

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants