[Python-checkins] python/dist/src/Lib locale.py,1.28,1.29

lemburg at users.sourceforge.net lemburg at users.sourceforge.net
Fri Dec 10 22:58:37 CET 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21415/Lib

Modified Files:
	locale.py 
Log Message:
locale.py now uses an updated locale alias table (built using
Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
alias file); the encoding lookup was enhanced to use Python's
encoding alias table

As sige-effect, this fixes SF bug [ 1080864 ] locale.py doesn't recognize
valid locale setting.


Index: locale.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/locale.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- locale.py	26 Jul 2004 12:45:18 -0000	1.28
+++ locale.py	10 Dec 2004 21:58:04 -0000	1.29
@@ -11,7 +11,7 @@
 
 """
 
-import sys
+import sys, encodings, encodings.aliases
 
 # Try importing the _locale module.
 #
@@ -223,22 +223,35 @@
         encoding = ''
 
[...1102 lines suppressed...]
+    'zh':                                   'zh_CN.eucCN',
+    'zh_cn':                                'zh_CN.gb2312',
+    'zh_cn.big5':                           'zh_TW.big5',
+    'zh_cn.euc':                            'zh_CN.eucCN',
+    'zh_cn.gb18030':                        'zh_CN.gb18030',
+    'zh_cn.gb2312':                         'zh_CN.gb2312',
+    'zh_cn.gbk':                            'zh_CN.gbk',
+    'zh_cn.utf8':                           'zh_CN.UTF-8',
+    'zh_hk':                                'zh_HK.big5hkscs',
+    'zh_hk.big5':                           'zh_HK.big5',
+    'zh_hk.big5hkscs':                      'zh_HK.big5hkscs',
+    'zh_hk.utf8':                           'zh_HK.UTF-8',
+    'zh_sg.utf8':                           'zh_SG.UTF-8',
+    'zh_tw':                                'zh_TW.big5',
+    'zh_tw.big5':                           'zh_TW.big5',
+    'zh_tw.euc':                            'zh_TW.eucTW',
+    'zh_tw.utf8':                           'zh_TW.UTF-8',
 }
 
 #



More information about the Python-checkins mailing list