Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > utf-8 in interactive python session

Reply
Thread Tools

utf-8 in interactive python session

 
 
Luke
Guest
Posts: n/a
 
      09-30-2004
Python doesn't seem to read UTF-8 properly from an interactive
session. Am I doing something wrong?

luked@sor ~ $ echo $LANG
en_AU.UTF-8
luked@sor ~ $ python
Python 2.3.4 (#1, Aug 12 2004, 17:23:54)
[GCC 3.4.1 (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.getdefaultencoding()

utf-8
>>> u'π' # embedded greek letter 'pi' (possibly mangled by

google groups news client), should return u'\u03c0'
u'\xcf\x80'
>>> u'\u03c0'.encode()

'\xcf\x80'
>>>

 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      09-30-2004
The problem is fixed in Python 2.4a2 and its later versions.
Please try one of them.

Hye-Shik

On 29 Sep 2004 23:36:48 -0700, Luke <(E-Mail Removed)> wrote:
> Python doesn't seem to read UTF-8 properly from an interactive
> session. Am I doing something wrong?
>
> luked@sor ~ $ echo $LANG
> en_AU.UTF-8
> luked@sor ~ $ python
> Python 2.3.4 (#1, Aug 12 2004, 17:23:54)
> [GCC 3.4.1 (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> print sys.getdefaultencoding()

> utf-8
> >>> u'π' # embedded greek letter 'pi' (possibly mangled by

> google groups news client), should return u'\u03c0'
> u'\xcf\x80'
> >>> u'\u03c0'.encode()

> '\xcf\x80'
> >>>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
interactive python session spool/save-log command? S. M. Tuttle Python 2 07-21-2005 02:29 AM
Interactive/Non-interactive ASPX ? WJ ASP .Net 2 02-26-2005 02:54 AM
non Interactive and Interactive AAH Computer Support 0 01-09-2005 04:09 PM
Interactive and non interactive AAH Computer Support 1 01-09-2005 04:01 PM
Re: List of declared variables in interactive Python session? vincent wehren Python 2 07-22-2003 07:07 AM



Advertisments