equal
deleted
inserted
replaced
268 u = path.decode('utf-8') |
268 u = path.decode('utf-8') |
269 except UnicodeDecodeError: |
269 except UnicodeDecodeError: |
270 # OS X percent-encodes any bytes that aren't valid utf-8 |
270 # OS X percent-encodes any bytes that aren't valid utf-8 |
271 s = '' |
271 s = '' |
272 pos = 0 |
272 pos = 0 |
273 l = len(s) |
273 l = len(path) |
274 while pos < l: |
274 while pos < l: |
275 try: |
275 try: |
276 c = encoding.getutf8char(path, pos) |
276 c = encoding.getutf8char(path, pos) |
277 pos += len(c) |
277 pos += len(c) |
278 except ValueError: |
278 except ValueError: |
279 c = '%%%%02X' % path[pos] |
279 c = '%%%02X' % ord(path[pos]) |
280 pos += 1 |
280 pos += 1 |
281 s += c |
281 s += c |
282 |
282 |
283 u = s.decode('utf-8') |
283 u = s.decode('utf-8') |
284 |
284 |