From 8ea29ede8127161e3d6e379a26a9dd323eecb3db Mon Sep 17 00:00:00 2001 From: Josip Pisoj Date: Sun, 3 Mar 2013 00:08:15 +0000 Subject: [PATCH] win32 fix svn: r21529 --- gramps/gen/datehandler/_grampslocale.py | 5 ++++- setup.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gramps/gen/datehandler/_grampslocale.py b/gramps/gen/datehandler/_grampslocale.py index 211bb64e2..e4926c271 100644 --- a/gramps/gen/datehandler/_grampslocale.py +++ b/gramps/gen/datehandler/_grampslocale.py @@ -45,7 +45,10 @@ else: try: codeset = glocale.get_translation().info()["charset"] except KeyError: - codeset = "UTF-8" + if win(): + codeset = locale.getlocale()[1] + else: + codeset = "UTF-8" try: diff --git a/setup.py b/setup.py index 7623f45d8..3d1512ab5 100644 --- a/setup.py +++ b/setup.py @@ -243,6 +243,9 @@ def write_const_py(command): data_dir = os.path.join(share_dir, 'gramps') image_dir = os.path.join(share_dir, 'gramps', 'icons', 'hicolor') doc_dir = os.path.join(share_dir, 'doc', 'gramps') + if sys.platform == 'win32': + locale_dir= locale_dir.replace('\\', '\\\\') + else: #in build if 'install' in command.distribution.command_obj: @@ -253,6 +256,8 @@ def write_const_py(command): data_dir = os.path.join(base_dir, 'data') image_dir = os.path.join(base_dir, 'images') doc_dir = base_dir + if sys.platform == 'win32': + locale_dir= locale_dir.replace('\\', '\\\\') subst_vars = (('@VERSIONSTRING@', VERSION), ('@LOCALE_DIR@', locale_dir),