[Patches] [ python-Patches-449815 ] Set filesystemencoding based on CODESET

noreply@sourceforge.net noreply@sourceforge.net
Wed, 05 Sep 2001 10:13:15 -0700


Patches item #449815, was opened at 2001-08-10 07:59
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=449815&group_id=5470

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Nobody/Anonymous (nobody)
Summary: Set filesystemencoding based on CODESET

Initial Comment:
This patch sets the Py_FileSystemDefaultEncoding in
each setlocale call if nl_langinfo(CODESET) is
available and returns a well-known codec name. This is
closest to the windows approach, which uses the "mbcs"
encoding.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2001-09-05 10:13

Message:
Logged In: YES 
user_id=21627

I've documented Py_FileSystemDefaultEncoding in api.tex
1.145, as read-only: on Windows, it is a static string with
the value "mbcs". Setting this is only allowed for platform
code, and all assigners must coordinate tightly (which
currently is Windows and Unix only).
The code itself is in _localemodule.c 2.23. I also added a
test case, which relies on support for the en_US locale;
this is in test_unicode_file.py 1.2.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-05 07:15

Message:
Logged In: YES 
user_id=6380

If you think this is how it should be done, go for it --
it's only an alpha release. (Famous last words. :-)

Question: are the intricate semantics of
Py_FileSystemDefaultEncoding sufficiently documented (e.g.
the fact that it must be malloc()'ed storage)?

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

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