If UTF-8 is used in env variable LANG, wrong date handler might be loaded.

svn: r17093
This commit is contained in:
Peter Landgren 2011-04-10 14:38:29 +00:00
parent 4274ea16f5
commit 673de5d297

View File

@ -58,6 +58,11 @@ LANG = ''
if "LANG" in os.environ:
LANG = os.environ["LANG"]
# If LANG contains ".UTF-8" use only the part to the left of "."
# Otherwise some date handler will not load.
if ".UTF-8" in LANG.upper():
LANG = LANG.split(".")[0]
if not LANG:
if not constfunc.win():
LANG = locale.getlocale(locale.LC_TIME)[0]