[Idle-dev] [ idlefork-Patches-508973 ] Support national characters

noreply@sourceforge.net noreply@sourceforge.net
Sun, 19 May 2002 20:11:32 -0700


Patches item #508973, was opened at 2002-01-27 08:36
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=309579&aid=508973&group_id=9579

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Nobody/Anonymous (nobody)
Summary: Support national characters

Initial Comment:
With the attached patch, IDLE will allow to edit text
with national characters, and properly save the file.

To achieve this, several mechanisms are used:
1. If the file has an emacs-style coding declartion
   (e.g. -*- coding: koi8-r -*-), this encoding will
   be used to load and store the file.

2. Otherwise, the locale's encoding will be used.
   This is determined as "mbcs" on Windows, and
nl_langinfo(CODESET) on Unix (requires Python 2.2). If
determination fails, "ascii" is used.

3. The text is encoded/decoded to the encoding
determined above. If that fails, saving falls back to
UTF-8, and loading falls back to passing a byte string
to Tcl.

4. In PyShell interactive mode, IOBinding.encoding is
used to encode Unicode strings before compiling them.

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

>Comment By: Stephen M. Gava (elguavas)
Date: 2002-05-20 13:11

Message:
Logged In: YES 
user_id=75867

Are you intending this patch for python idle? If so you need
to submit it to the python patch manager.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-01-27 08:37

Message:
Logged In: YES 
user_id=21627

If you want to verify that the patch functions correctly,
please open the attached mvl.py, which should have two
strings; a latin one (with a single umlaut) and a cyrillic one.

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=309579&aid=508973&group_id=9579