comparison 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 (2011-12-16)
parents d6c19cfa03ce
children 7b7f03502b5a
comparison
equal deleted inserted replaced
15671:3c5e818ac679 15672:2ebe3d0ce91d
21 21
22 if os.name == 'nt': 22 if os.name == 'nt':
23 import windows as platform 23 import windows as platform
24 else: 24 else:
25 import posix as platform 25 import posix as platform
26
27 platform.encodinglower = encoding.lower
28 platform.encodingupper = encoding.upper
26 29
27 cachestat = platform.cachestat 30 cachestat = platform.cachestat
28 checkexec = platform.checkexec 31 checkexec = platform.checkexec
29 checklink = platform.checklink 32 checklink = platform.checklink
30 copymode = platform.copymode 33 copymode = platform.copymode