[GRASS-SVN] r70769 - grass/branches/releasebranch_7_2/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 18 22:20:03 PDT 2017
Author: hcho
Date: 2017-03-18 22:20:03 -0700 (Sat, 18 Mar 2017)
New Revision: 70769
Modified:
grass/branches/releasebranch_7_2/lib/init/grass.py
Log:
grass.py: Force encoding to be EUC-KR for the Korean language in Windows (backport r70767)
Modified: grass/branches/releasebranch_7_2/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/init/grass.py 2017-03-19 05:16:00 UTC (rev 70768)
+++ grass/branches/releasebranch_7_2/lib/init/grass.py 2017-03-19 05:20:03 UTC (rev 70769)
@@ -1155,10 +1155,19 @@
# Set up environment for subprocesses
os.environ['LANGUAGE'] = language
os.environ['LANG'] = language
- if encoding:
+
+ if language == 'ko_KR' and encoding == 'cp949':
+ # The default encoding for the Korean language in Windows is cp949,
+ # Microsoft's proprietary extension to euc-kr, but gettext prints no
+ # translated messages at all in the Command Prompt window if LC_CTYPE
+ # is set to ko_KR.cp949. Here, force LC_CTYPE to be euc-kr.
+ normalized = 'euc-kr'
+ encoding = None
+ elif encoding:
normalized = locale.normalize('%s.%s' % (language, encoding))
else:
normalized = language
+
for lc in ('LC_CTYPE', 'LC_MESSAGES', 'LC_TIME', 'LC_COLLATE',
'LC_MONETARY', 'LC_PAPER', 'LC_NAME', 'LC_ADDRESS',
'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION'):
More information about the grass-commit
mailing list