From da460a4b970734b99ac60018992950f5b9122eda Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 19 Aug 2013 21:23:17 +0000 Subject: [PATCH] Bug 7002: Gramps crashes when environment varable LANG is not set to C Force $LANG to have UTF-8 suffix. svn: r22878 --- src/TransUtils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TransUtils.py b/src/TransUtils.py index c4aa18fdb..9bd8f798f 100644 --- a/src/TransUtils.py +++ b/src/TransUtils.py @@ -85,6 +85,10 @@ else: logging.warning('Unable to determine your Locale, using English') lang = 'en.UTF-8' + _lang_ = lang.replace('@', '.').split('.') + if not (len(_lang_) == 2 and _lang_[1] == 'UTF-8'): + lang = _lang_[0] + '.UTF-8' + os.environ["LANG"] = lang os.environ["LANGUAGE"] = lang