New submission from Antoine Pitrou: 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. ---------- components: Extension Modules messages: 61970 nosy: pitrou severity: normal status: open title: localeconv() does not encode returned strings type: behavior versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1995> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com