Bug #5044: Unable to enter valid dates when the (full) month contains accented letters.

This turns out to be a codeset-setting issue, where unicode() returns different (perfectly valid) encodings of the words depending upon which codeset it's given.

There's also a problem with using locale.getpreferredencoding() on OSX: It returns "mac roman", pretty much regardless of the environment locale settings. This isn't correct for recent versions of OSX under any circumstances, so this change also disables calling it on macs.

svn: r17859
This commit is contained in:
John Ralls
2011-06-28 23:05:53 +00:00
parent d8560551fa
commit ee5d62701e
3 changed files with 9 additions and 3 deletions

View File

@ -260,3 +260,4 @@ def mac_setup_localization(dir, domain):
lang = mac_resolve_locale(collation)
if lang != None:
os.environ["LANG"] = lang
os.environ["LC_CTYPE"] = lang + ".UTF-8"