Hi Pierre-Henri You see an inconsistency between 'python2.7' and 'spyder python2.7' behaviour.
'\xe9' is the code of "é" in 'latin1'. '\xc3\xa9' is the code of "é" in unicode 'utf-8' Try this , so we can see if you have indeed a 'latin1' or 'cp1252' showing up somewhere in your config. >>>import locale;import sys;print(locale.getdefaultlocale(),locale.getpreferredencoding(),sys.getdefaultencoding()) Le jeudi 5 septembre 2013 14:40:02 UTC+2, Pierre-Henri a écrit : > > Hi, > > My computer is running osx 10.8.4, localized in french (LANG = > fr_FR.UTF-8) > > In a python (2.7) console (not within spyder) launched in a terminal, I get > >>> s = 'é' ; s; len(s) > '\xc3\xa9' > 2 > > >>> s = u'é'; s; len(s) > u'\xe9' > 1 > > I get the same result within an iPython console, within spyder. > > But, within spyder, in a python console, I do get this instead : > >>> s = 'é' ; s; len(s) > '\xc3\xa9' > 2 > > >>> s = u'é'; s; len(s) > '\xc3\xa9' > 2 > > I suspected the LANG environment variable was the reason, as within spyder > (2.2.1 DMG), from the output of os.environ, I get en_US for LANG instead, > but when I run from the terminal a port installed 2.2.2 spyder, in which > os.environ shows fr_FR.UTF-8 for the LANG env variable, I get the same > strange (for me) result than the last one quoted above, so that is not the > explanation. > > So what could be the explanation for this difference ? > > Thanks, > > Pierre-Henri > > -- You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/spyderlib. For more options, visit https://groups.google.com/groups/opt_out.
