diff mercurial/util.py @ 15672:2ebe3d0ce91d stable

i18n: use encoding.lower/upper for encoding aware case folding this patch uses encoding.lower/upper for case folding, because ones of str can not fold case of non ascii characters correctly. to avoid cyclic dependency and to encapsulate logic of normcase in each platforms, this patch introduces encodinglower/encodingupper in both posix/windows specific files. this patch does not change implementation of normcase() in posix.py, because we do not know the encoding of filenames on POSIX. some "normcase()" are excluded from function wrap list in hgext/win32mbcs.py, because they become encoding aware by this patch.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 16 Dec 2011 21:09:41 +0900
parents d6c19cfa03ce
children 7b7f03502b5a
line wrap: on
line diff
--- a/mercurial/util.py	Fri Dec 16 21:09:40 2011 +0900
+++ b/mercurial/util.py	Fri Dec 16 21:09:41 2011 +0900
@@ -24,6 +24,9 @@
 else:
     import posix as platform
 
+platform.encodinglower = encoding.lower
+platform.encodingupper = encoding.upper
+
 cachestat = platform.cachestat
 checkexec = platform.checkexec
 checklink = platform.checklink