[IPython-dev] IPython cannot display e acute accent
Fernando Perez
fperez.net at gmail.com
Mon Sep 17 12:44:29 EDT 2007
On 9/17/07, Nicolas Girard <nicolas.girard at nerim.net> wrote:
> Here's what I get (I just copied & pasted your print statement in both an
> IPython and a python session:
>
> ------------------------------------
> $ ipython
> Python 2.5.1 (r251:54863, Aug 23 2007, 07:07:32)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.8.1 -- An enhanced Interactive Python.
> ? -> Introduction to IPython's features.
> %magic -> Information about IPython's 'magic' % functions.
> help -> Python's own help system.
> object? -> Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: print "á íóú àèìòöü ñÑ çÇ(c)"
> á Ãóú ÃÚìòöÌ ñà çÃ(c)
>
> In [2]: import sys
>
> In [3]: sys.stdin.encoding
> Out[3]: 'ISO-8859-15'
>
> In [4]: sys.stdout.encoding
> Out[4]: 'ISO-8859-15'
>
>
> $ python
> Python 2.5.1 (r251:54863, Aug 23 2007, 07:07:32)
> [GCC 4.2.1 20070802 (prerelease) (4.2.1-4mdv2008.0)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print "áéíóú àèìòù äëïöü ñÑ çÇ(c)"
> áéíóú àèìòù äëïöü ñÑ çÇ(c)
> >>> import sys
> >>> sys.stdin.encoding
> 'ISO-8859-15'
> >>> sys.stdout.encoding
> 'ISO-8859-15'
> ------------------------------------
>
>
> > Very strange. More platform details are definitely needed.
>
> I'd be glad to provide any detail you would need, but I don't see what else is
> worth mentionning
Mmh. Indeed, I'm on UTF-8 as Gael suspected:
In [1]: print "áéíóú àèìòù äëïöü ñÑ çÇ(c)"
áéíóú àèìòù äëïöü ñÑ çÇ(c)
In [2]: sys.stdin.encoding
Out[2]: 'UTF-8'
In [3]: sys.stdout.encoding
Out[3]: 'UTF-8'
So we seem to be mishandling other encodings. Suggestions from
unicode experts would be welcome. I thought we'd fixed all the
remaining unicode issues, but apparently not. Bummer...
Cheers,
f
More information about the IPython-dev
mailing list