Bugs item #1495089, was opened at 2006-05-25 18:12
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1495089&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
>Status: Closed
>Resolution: Works For Me
Priority: 5
Submitted By: Felix Wiemann (fwiemann)
Assigned to: Nobody/Anonymous (nobody)
Summary: sys.getfilesystemencoding

Initial Comment:
There seems to be a mistake in the documentation of
sys.getfilesystemdocumentation in module-sys.html:

"On Unix, the encoding is the user's preference
according to the result of nl_langinfo(CODESET), or
None if the nl_langinfo(CODESET) failed."

This does not seem to be the case on my system:

>>> import sys
>>> sys.getfilesystemencoding()
'UTF-8'
>>> import locale
>>> locale.nl_langinfo(locale.CODESET)
'ANSI_X3.4-1968'

FYI my locale environment:

$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=POSIX
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

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

>Comment By: Georg Brandl (gbrandl)
Date: 2006-05-25 18:21

Message:
Logged In: YES 
user_id=849994

You must first set your current locale to the system default
locale; on start, Python's locale defaults to C.

After 'locale.setlocale(locale.LC_ALL, "")' the nl_langinfo
call should yield "UTF-8".

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1495089&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to