##// END OF EJS Templates
darwin: omit ignorable codepoints when normcase()ing a file path...
Augie Fackler -
r23597:7a5bcd47 stable
parent child Browse files
Show More
@@ -208,6 +208,7 b" if sys.platform == 'darwin':"
208 208 - escape-encode invalid characters
209 209 - decompose to NFD
210 210 - lowercase
211 - omit ignored characters [200c-200f, 202a-202e, 206a-206f,feff]
211 212
212 213 >>> normcase('UPPER')
213 214 'upper'
@@ -265,7 +266,9 b" if sys.platform == 'darwin':"
265 266 u = s.decode('utf-8')
266 267
267 268 # Decompose then lowercase (HFS+ technote specifies lower)
268 return unicodedata.normalize('NFD', u).lower().encode('utf-8')
269 enc = unicodedata.normalize('NFD', u).lower().encode('utf-8')
270 # drop HFS+ ignored characters
271 return encoding.hfsignoreclean(enc)
269 272
270 273 if sys.platform == 'cygwin':
271 274 # workaround for cygwin, in which mount point part of path is
@@ -200,12 +200,11 b' case changes.'
200 200 We assume anyone running the tests on a case-insensitive volume on OS
201 201 X will be using HFS+. If that's not true, this test will fail.
202 202
203 Bug: some codepoints are to be ignored on HFS+:
204
205 203 $ rm A
206 204 >>> open(u'a\u200c'.encode('utf-8'), 'w').write('unicode is fun')
207 205 $ hg status
208 206 M A
209 ? a\xe2\x80\x8c (esc)
207
210 208 #endif
209
211 210 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now