[GRASS-SVN] r60307 - grass/trunk/gui/wxpython
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 18 01:05:52 PDT 2014
Author: hcho
Date: 2014-05-18 01:05:51 -0700 (Sun, 18 May 2014)
New Revision: 60307
Added:
grass/trunk/gui/wxpython/sitecustomize.py
Modified:
grass/trunk/gui/wxpython/Makefile
Log:
wxPython GUI: Set the default encoding based on LC_CTYPE. Fix tickets #1856 and #2120.
Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile 2014-05-18 07:37:04 UTC (rev 60306)
+++ grass/trunk/gui/wxpython/Makefile 2014-05-18 08:05:51 UTC (rev 60307)
@@ -14,7 +14,7 @@
gui_core/*.py iclass/* lmgr/*.py location_wizard/*.py mapwin/*.py mapdisp/*.py \
mapswipe/* modules/*.py nviz/*.py psmap/* rlisetup/* timeline/* vdigit/* \
vnet/*.py web_services/*.py wxplot/*.py iscatt/*.py) \
- gis_set.py gis_set_error.py wxgui.py README
+ sitecustomize.py gis_set.py gis_set_error.py wxgui.py README
DSTFILES := $(patsubst %,$(DSTDIR)/%,$(SRCFILES)) \
$(patsubst %.py,$(DSTDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
Added: grass/trunk/gui/wxpython/sitecustomize.py
===================================================================
--- grass/trunk/gui/wxpython/sitecustomize.py (rev 0)
+++ grass/trunk/gui/wxpython/sitecustomize.py 2014-05-18 08:05:51 UTC (rev 60307)
@@ -0,0 +1,17 @@
+"""!
+Default encoding for wxPython GRASS GUI.
+
+(C) 2014 by the GRASS Development Team
+
+This program is free software under the GNU General Public License
+(>=v2). Read the file COPYING that comes with GRASS for details.
+
+ at author Huidae Cho <grass4u gmail.com>
+"""
+
+import os
+import sys
+
+lang = os.environ["LC_CTYPE"].split(".")
+if len(lang) == 2:
+ sys.setdefaultencoding(lang[1].lower())
More information about the grass-commit
mailing list