Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
15671:3c5e818ac679 | 15672:2ebe3d0ce91d |
---|---|
129 return path.replace('/', '\\') | 129 return path.replace('/', '\\') |
130 | 130 |
131 def normpath(path): | 131 def normpath(path): |
132 return pconvert(os.path.normpath(path)) | 132 return pconvert(os.path.normpath(path)) |
133 | 133 |
134 encodinglower = None | |
135 encodingupper = None | |
136 | |
134 def normcase(path): | 137 def normcase(path): |
135 return path.upper() | 138 return encodingupper(path) |
136 | 139 |
137 def realpath(path): | 140 def realpath(path): |
138 ''' | 141 ''' |
139 Returns the true, canonical file system path equivalent to the given | 142 Returns the true, canonical file system path equivalent to the given |
140 path. | 143 path. |