From 618aa42f69667893b2cbf5ac9a97b393aa3a1c73 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Sun, 10 Apr 2011 14:39:01 +0000 Subject: [PATCH] If UTF-8 is used in env variable LANG, wrong date handler might be loaded. svn: r17094 --- 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]