#13296: matplotlib do not handle unicode properly from command line
---------------------------------------+------------------------------------
       Reporter:  slabbe               |         Owner:  jason, was  
           Type:  defect               |        Status:  needs_review
       Priority:  major                |     Milestone:  sage-5.3    
      Component:  graphics             |    Resolution:              
       Keywords:  unicode, matplotlib  |   Work issues:              
Report Upstream:  N/A                  |     Reviewers:              
        Authors:  John Palmieri        |     Merged in:              
   Dependencies:                       |      Stopgaps:              
---------------------------------------+------------------------------------

Comment (by slabbe):

 Great, thanks for the documentation link. I just read all of it. I now see
 the difference between unicode and utf-8, which I was seeing vaguely as
 synonyms.

 Surprisingly, whereas Sage returns {{{False}}}, in Python 2.6 and 2.7,
 {{{ss == s}}} returns {{{True}}}:

 {{{
 #!python
 >>> s = unicode('an accent : é', encoding='utf-8')
 >>> ss = u'an accent : é'
 >>> s == ss
 True
 }}}

 That means utf-8 is the default encoding in Python 2.7 for unicode
 strings. In more details:

 {{{
 Python 2.7.2 (default, May 30 2012, 14:00:43)
 [GCC 4.6.3] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> 'é'
 '\xc3\xa9'
 >>> u'é'
 u'\xe9'
 >>> unicode('é', encoding='utf-8')
 u'\xe9'
 }}}

 But, in sage-5.0, latin1 seems to be the default encoding for unicode
 strings :

 {{{
 sage: 'é'
 '\xc3\xa9'
 sage: u'é'
 u'\xc3\xa9'
 sage: unicode('é', encoding='latin1')
 u'\xc3\xa9'
 sage: unicode('é', encoding='utf-8')
 u'\xe9'
 }}}

 I did not look at the patch yet.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13296#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to