[Patches] [ python-Patches-941229 ] Allow any encodings other than latin-1 in interactive interp

SourceForge.net noreply at sourceforge.net
Wed Apr 28 16:34:42 EDT 2004


Patches item #941229, was opened at 2004-04-24 11:49
Message generated for change (Settings changed) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=941229&group_id=5470

Category: Parser/Compiler
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Hye-Shik Chang (perky)
>Assigned to: Martin v. Löwis (loewis)
Summary: Allow any encodings other than latin-1 in interactive interp

Initial Comment:
Python interactive interpreter uses ISO-8859-1 for
parsing incoming codes from sys.stdin whatever
sys.stdin.encoding is.
This patch allows to use locale-aware encodings other
than ISO-8859-1 in interactive sessions.

eg.

Before:

>>> u'한글'  # (U+D55C, U+AE00)
u'\xc7\xd1\xb1\xdb'

After:

>>> u'한글'
u'\ud55c\uae00'


The attached sample implementation fall backs to
ISO-8859-1 for any non-memory errors such as
UnicodeDecodeError. So if you use ascii or iso-8859-1,
you'll not able to find difference. It intended to
affect to non-latin-1 encoding users.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=941229&group_id=5470



More information about the Patches mailing list