From 673de5d297e77055f57a09b565c2b8db1856d17e Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Sun, 10 Apr 2011 14:38:29 +0000 Subject: [PATCH] If UTF-8 is used in env variable LANG, wrong date handler might be loaded. svn: r17093 --- src/DateHandler/_DateHandler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/DateHandler/_DateHandler.py b/src/DateHandler/_DateHandler.py index 0a0728dc5..d82ee73b4 100644 --- a/src/DateHandler/_DateHandler.py +++ b/src/DateHandler/_DateHandler.py @@ -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]