This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients pitrou
Date 2008-02-01.18:13:47
SpamBayes Score 0.061585523
Marked as misclassified No
Message-id <1201889628.47.0.925128224389.issue1995@psf.upfronthosting.co.za>
In-reply-to
Content
Some values in the dict returned by localeconv() may be non-ASCII
strings, yet they are not decoded according to the locale's character
set. This can be observed when the currency symbol is the euro sign:

>>> import locale
>>> locale.setlocale(locale.LC_MONETARY, 'fr_FR.UTF-8')
'fr_FR.UTF-8'
>>> locale.localeconv()['currency_symbol']
'\xe2\x82\xac'
>>> locale.setlocale(locale.LC_MONETARY, 'fr_FR.ISO8859-15')
'fr_FR.ISO8859-15'
>>> locale.localeconv()['currency_symbol']
'\xa4'

localeconv() is defined in the _locale module, which has no knowledge of
the current encoding - but the locale module does. So we could redefine
localeconv() in locale as a wrapper, to do the proper encoding dance.
History
Date User Action Args
2008-02-01 18:13:48pitrousetspambayes_score: 0.0615855 -> 0.061585523
recipients: + pitrou
2008-02-01 18:13:48pitrousetspambayes_score: 0.0615855 -> 0.0615855
messageid: <1201889628.47.0.925128224389.issue1995@psf.upfronthosting.co.za>
2008-02-01 18:13:47pitroulinkissue1995 messages
2008-02-01 18:13:47pitroucreate