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

noreply@sourceforge.net noreply@sourceforge.net
Sat, 26 Jan 2002 13:36:00 -0800


Patches item #508973, was opened at 2002-01-26 13: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.

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

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