Mercurial > hg
diff mercurial/posix.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 | b61fa7481a68 |
children | c51c9dc13a58 |
line wrap: on
line diff
--- a/mercurial/posix.py Fri Dec 16 21:09:40 2011 +0900 +++ b/mercurial/posix.py Fri Dec 16 21:09:41 2011 +0900 @@ -164,6 +164,9 @@ st2 = os.lstat(fpath2) return st1.st_dev == st2.st_dev +encodinglower = None +encodingupper = None + # os.path.normcase is a no-op, which doesn't help us on non-native filesystems def normcase(path): return path.lower()