diff mercurial/windows.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 3c5e818ac679
children 7b7f03502b5a
line wrap: on
line diff
--- a/mercurial/windows.py	Fri Dec 16 21:09:40 2011 +0900
+++ b/mercurial/windows.py	Fri Dec 16 21:09:41 2011 +0900
@@ -131,8 +131,11 @@
 def normpath(path):
     return pconvert(os.path.normpath(path))
 
+encodinglower = None
+encodingupper = None
+
 def normcase(path):
-    return path.upper()
+    return encodingupper(path)
 
 def realpath(path):
     '''