[issue10154] locale.normalize strips "-" from UTF-8, which fails on Mac

Ronald Oussoren report at bugs.python.org
Tue Dec 7 15:29:45 CET 2010


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

UTF-8 works on SuSE Enterprise Linux 9 and 10 as well. 

BTW, neither UTF8 nor UTF-8 work on HPUX 10. That platform requires spelling it as utf8. 

This sadly enought means that this code doesn't work on HPUX 10:

>>> locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python2.7/lib/python2.7/locale.py", line 531, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

That's because getdefaultlocale returns 'UTF8' as the encoding, even though LANG is set to 'nl_NL.utf8' (which is a working locale on the machine I tested).

BTW. I'm +1 on changing the alias table as Marc-Andre proposed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10154>
_______________________________________


More information about the Python-bugs-list mailing list