New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localeconv() does not encode returned strings #46279
Comments
Some values in the dict returned by localeconv() may be non-ASCII >>> 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 |
Here is a patch fixing the problem. Note however that it will make |
The locale module is completely broken; don't try to work around that |
Perhaps it is broken - it does look rather fragile - but are there any |
If people could contribute an ICU wrapper - that would be nice. However, |
I found now a way to fix this, by relying on wchar_t functions. It's |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: