[ python-Bugs-1062261 ] locale.getdefaultlocale() returns wrong encoding

SourceForge.net noreply at sourceforge.net
Mon Nov 8 12:03:05 CET 2004


Bugs item #1062261, was opened at 2004-11-08 02:11
Message generated for change (Comment added) made by ajung
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1062261&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Andreas Jung (ajung)
Assigned to: Nobody/Anonymous (nobody)
Summary: locale.getdefaultlocale() returns wrong encoding

Initial Comment:
ajung at localhost:~/sandboxes/Zope/Zope: locale
LANG=
LC_CTYPE=fr_FR.UTF8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
ajung at localhost:~/sandboxes/Zope/Zope: python2.3
Python 2.3.4 (#1, Nov  6 2004, 11:45:40)
[GCC 3.4.2] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import locale
>>> locale.getpreferredencoding()
'UTF-8'
>>> locale.getdefaultlocale()
['fr_FR', 'utf']
>>>

As you can see the encoding is set to 'UTF-8' but
getdefaultlocale()
returns only 'utf'. If I set LC_CTYPE e.g. to
'fr_FR.iso-8859-10 then the
right encoding is returned.

Affected: Python 2.3.4, 2.4b1
OS: Linux i386 Fedora Core 2

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

>Comment By: Andreas Jung (ajung)
Date: 2004-11-08 06:03

Message:
Logged In: YES 
user_id=11084

hmmm...what about utf16, utf32?

-aj

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

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-11-08 05:57

Message:
Logged In: YES 
user_id=469548

In Python, 'utf' is an alias for 'utf-8'. With that
knowledge, is this still a problem?

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

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


More information about the Python-bugs-list mailing list