Show More
@@ -10,12 +10,16 b' from __future__ import absolute_import' | |||||
10 | import array |
|
10 | import array | |
11 | import locale |
|
11 | import locale | |
12 | import os |
|
12 | import os | |
|
13 | import sys | |||
13 | import unicodedata |
|
14 | import unicodedata | |
14 |
|
15 | |||
15 | from . import ( |
|
16 | from . import ( | |
16 | error, |
|
17 | error, | |
17 | ) |
|
18 | ) | |
18 |
|
19 | |||
|
20 | if sys.version_info[0] >= 3: | |||
|
21 | unichr = chr | |||
|
22 | ||||
19 | # These unicode characters are ignored by HFS+ (Apple Technote 1150, |
|
23 | # These unicode characters are ignored by HFS+ (Apple Technote 1150, | |
20 | # "Unicode Subtleties"), so we need to ignore them in some places for |
|
24 | # "Unicode Subtleties"), so we need to ignore them in some places for | |
21 | # sanity. |
|
25 | # sanity. | |
@@ -23,7 +27,10 b' from . import (' | |||||
23 | "200c 200d 200e 200f 202a 202b 202c 202d 202e " |
|
27 | "200c 200d 200e 200f 202a 202b 202c 202d 202e " | |
24 | "206a 206b 206c 206d 206e 206f feff".split()] |
|
28 | "206a 206b 206c 206d 206e 206f feff".split()] | |
25 | # verify the next function will work |
|
29 | # verify the next function will work | |
26 | assert set([i[0] for i in _ignore]) == set(["\xe2", "\xef"]) |
|
30 | if sys.version_info[0] >= 3: | |
|
31 | assert set(i[0] for i in _ignore) == set([ord(b'\xe2'), ord(b'\xef')]) | |||
|
32 | else: | |||
|
33 | assert set(i[0] for i in _ignore) == set(["\xe2", "\xef"]) | |||
27 |
|
34 | |||
28 | def hfsignoreclean(s): |
|
35 | def hfsignoreclean(s): | |
29 | """Remove codepoints ignored by HFS+ from s. |
|
36 | """Remove codepoints ignored by HFS+ from s. |
General Comments 0
You need to be logged in to leave comments.
Login now