Show More
@@ -176,13 +176,15 b" if sys.platform == 'darwin':" | |||
|
176 | 176 | u = path.decode('utf-8') |
|
177 | 177 | except UnicodeDecodeError: |
|
178 | 178 | # percent-encode any characters that don't round-trip |
|
179 |
p2 = path.decode('utf-8', 're |
|
|
179 | p2 = path.decode('utf-8', 'ignore').encode('utf-8') | |
|
180 | 180 | s = "" |
|
181 | for a, b in zip(path, p2): | |
|
182 |
|
|
|
183 | s += "%%%02X" % ord(a) | |
|
181 | pos = 0 | |
|
182 | for c in path: | |
|
183 | if p2[pos:pos + 1] == c: | |
|
184 | s += c | |
|
185 | pos += 1 | |
|
184 | 186 | else: |
|
185 |
s += |
|
|
187 | s += "%%%02X" % ord(c) | |
|
186 | 188 | u = s.decode('utf-8') |
|
187 | 189 | |
|
188 | 190 | # Decompose then lowercase (HFS+ technote specifies lower) |
General Comments 0
You need to be logged in to leave comments.
Login now