Skip to content

Commit 3eef168

Browse files
authored
Merge pull request #194 from kjd/revert-unicode-16
Revert Unicode 16.0.0 data updates
2 parents c43ac75 + ceca619 commit 3eef168

File tree

3 files changed

+746
-1010
lines changed

3 files changed

+746
-1010
lines changed

idna/core.py

+8-46
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,6 @@
99
_virama_combining_class = 9
1010
_alabel_prefix = b"xn--"
1111
_unicode_dots_re = re.compile("[\u002e\u3002\uff0e\uff61]")
12-
_ldh = (
13-
48,
14-
49,
15-
50,
16-
51,
17-
52,
18-
53,
19-
54,
20-
55,
21-
56,
22-
57,
23-
95,
24-
97,
25-
98,
26-
99,
27-
100,
28-
101,
29-
102,
30-
103,
31-
104,
32-
105,
33-
106,
34-
107,
35-
108,
36-
109,
37-
110,
38-
111,
39-
112,
40-
113,
41-
114,
42-
115,
43-
116,
44-
117,
45-
118,
46-
119,
47-
120,
48-
121,
49-
122,
50-
)
5112

5213

5314
class IDNAError(UnicodeError):
@@ -380,16 +341,17 @@ def uts46_remap(domain: str, std3_rules: bool = True, transitional: bool = False
380341
uts46row = uts46data[code_point if code_point < 256 else bisect.bisect_left(uts46data, (code_point, "Z")) - 1]
381342
status = uts46row[1]
382343
replacement: Optional[str] = None
383-
if std3_rules and code_point <= 0x7F:
384-
if code_point not in _ldh:
385-
raise InvalidCodepoint(
386-
"Codepoint {} at position {} does not follow STD3 rules".format(_unot(code_point), pos + 1)
387-
)
388344
if len(uts46row) == 3:
389345
replacement = uts46row[2]
390-
if status == "V" or (status == "D" and not transitional):
346+
if (
347+
status == "V"
348+
or (status == "D" and not transitional)
349+
or (status == "3" and not std3_rules and replacement is None)
350+
):
391351
output += char
392-
elif replacement is not None and (status == "M" or (status == "D" and transitional)):
352+
elif replacement is not None and (
353+
status == "M" or (status == "3" and not std3_rules) or (status == "D" and transitional)
354+
):
393355
output += replacement
394356
elif status != "I":
395357
raise IndexError()

idna/idnadata.py

+6-72
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# This file is automatically generated by tools/idna-data
22

3-
__version__ = "16.0.0"
4-
3+
__version__ = "15.1.0"
54
scripts = {
65
"Greek": (
76
0x37000000374,
@@ -728,7 +727,6 @@
728727
0x88C: 68,
729728
0x88D: 68,
730729
0x88E: 82,
731-
0x897: 84,
732730
0x898: 84,
733731
0x899: 84,
734732
0x89A: 84,
@@ -1875,17 +1873,8 @@
18751873
0x10D25: 84,
18761874
0x10D26: 84,
18771875
0x10D27: 84,
1878-
0x10D69: 84,
1879-
0x10D6A: 84,
1880-
0x10D6B: 84,
1881-
0x10D6C: 84,
1882-
0x10D6D: 84,
18831876
0x10EAB: 84,
18841877
0x10EAC: 84,
1885-
0x10EC2: 82,
1886-
0x10EC3: 68,
1887-
0x10EC4: 68,
1888-
0x10EFC: 84,
18891878
0x10EFD: 84,
18901879
0x10EFE: 84,
18911880
0x10EFF: 84,
@@ -2064,17 +2053,6 @@
20642053
0x11372: 84,
20652054
0x11373: 84,
20662055
0x11374: 84,
2067-
0x113BB: 84,
2068-
0x113BC: 84,
2069-
0x113BD: 84,
2070-
0x113BE: 84,
2071-
0x113BF: 84,
2072-
0x113C0: 84,
2073-
0x113CE: 84,
2074-
0x113D0: 84,
2075-
0x113D2: 84,
2076-
0x113E1: 84,
2077-
0x113E2: 84,
20782056
0x11438: 84,
20792057
0x11439: 84,
20802058
0x1143A: 84,
@@ -2130,6 +2108,7 @@
21302108
0x116B5: 84,
21312109
0x116B7: 84,
21322110
0x1171D: 84,
2111+
0x1171E: 84,
21332112
0x1171F: 84,
21342113
0x11722: 84,
21352114
0x11723: 84,
@@ -2286,7 +2265,6 @@
22862265
0x11F3A: 84,
22872266
0x11F40: 84,
22882267
0x11F42: 84,
2289-
0x11F5A: 84,
22902268
0x13430: 84,
22912269
0x13431: 84,
22922270
0x13432: 84,
@@ -2319,21 +2297,6 @@
23192297
0x13453: 84,
23202298
0x13454: 84,
23212299
0x13455: 84,
2322-
0x1611E: 84,
2323-
0x1611F: 84,
2324-
0x16120: 84,
2325-
0x16121: 84,
2326-
0x16122: 84,
2327-
0x16123: 84,
2328-
0x16124: 84,
2329-
0x16125: 84,
2330-
0x16126: 84,
2331-
0x16127: 84,
2332-
0x16128: 84,
2333-
0x16129: 84,
2334-
0x1612D: 84,
2335-
0x1612E: 84,
2336-
0x1612F: 84,
23372300
0x16AF0: 84,
23382301
0x16AF1: 84,
23392302
0x16AF2: 84,
@@ -2642,8 +2605,6 @@
26422605
0x1E4ED: 84,
26432606
0x1E4EE: 84,
26442607
0x1E4EF: 84,
2645-
0x1E5EE: 84,
2646-
0x1E5EF: 84,
26472608
0x1E8D0: 84,
26482609
0x1E8D1: 84,
26492610
0x1E8D2: 84,
@@ -3367,7 +3328,7 @@
33673328
0x8600000086B,
33683329
0x87000000888,
33693330
0x8890000088F,
3370-
0x897000008E2,
3331+
0x898000008E2,
33713332
0x8E300000958,
33723333
0x96000000964,
33733334
0x96600000970,
@@ -3602,7 +3563,6 @@
36023563
0x1C0000001C38,
36033564
0x1C4000001C4A,
36043565
0x1C4D00001C7E,
3605-
0x1C8A00001C8B,
36063566
0x1CD000001CD3,
36073567
0x1CD400001CFB,
36083568
0x1D0000001D2C,
@@ -3966,13 +3926,11 @@
39663926
0xA7C30000A7C4,
39673927
0xA7C80000A7C9,
39683928
0xA7CA0000A7CB,
3969-
0xA7CD0000A7CE,
39703929
0xA7D10000A7D2,
39713930
0xA7D30000A7D4,
39723931
0xA7D50000A7D6,
39733932
0xA7D70000A7D8,
39743933
0xA7D90000A7DA,
3975-
0xA7DB0000A7DC,
39763934
0xA7F60000A7F8,
39773935
0xA7FA0000A828,
39783936
0xA82C0000A82D,
@@ -4042,7 +4000,6 @@
40424000
0x105A3000105B2,
40434001
0x105B3000105BA,
40444002
0x105BB000105BD,
4045-
0x105C0000105F4,
40464003
0x1060000010737,
40474004
0x1074000010756,
40484005
0x1076000010768,
@@ -4080,14 +4037,10 @@
40804037
0x10CC000010CF3,
40814038
0x10D0000010D28,
40824039
0x10D3000010D3A,
4083-
0x10D4000010D50,
4084-
0x10D6900010D6E,
4085-
0x10D6F00010D86,
40864040
0x10E8000010EAA,
40874041
0x10EAB00010EAD,
40884042
0x10EB000010EB2,
4089-
0x10EC200010EC5,
4090-
0x10EFC00010F1D,
4043+
0x10EFD00010F1D,
40914044
0x10F2700010F28,
40924045
0x10F3000010F51,
40934046
0x10F7000010F86,
@@ -4133,16 +4086,6 @@
41334086
0x1135D00011364,
41344087
0x113660001136D,
41354088
0x1137000011375,
4136-
0x113800001138A,
4137-
0x1138B0001138C,
4138-
0x1138E0001138F,
4139-
0x11390000113B6,
4140-
0x113B7000113C1,
4141-
0x113C2000113C3,
4142-
0x113C5000113C6,
4143-
0x113C7000113CB,
4144-
0x113CC000113D4,
4145-
0x113E1000113E3,
41464089
0x114000001144B,
41474090
0x114500001145A,
41484091
0x1145E00011462,
@@ -4157,7 +4100,6 @@
41574100
0x116500001165A,
41584101
0x11680000116B9,
41594102
0x116C0000116CA,
4160-
0x116D0000116E4,
41614103
0x117000001171B,
41624104
0x1171D0001172C,
41634105
0x117300001173A,
@@ -4181,8 +4123,6 @@
41814123
0x11A5000011A9A,
41824124
0x11A9D00011A9E,
41834125
0x11AB000011AF9,
4184-
0x11BC000011BE1,
4185-
0x11BF000011BFA,
41864126
0x11C0000011C09,
41874127
0x11C0A00011C37,
41884128
0x11C3800011C41,
@@ -4207,16 +4147,14 @@
42074147
0x11F0000011F11,
42084148
0x11F1200011F3B,
42094149
0x11F3E00011F43,
4210-
0x11F5000011F5B,
4150+
0x11F5000011F5A,
42114151
0x11FB000011FB1,
42124152
0x120000001239A,
42134153
0x1248000012544,
42144154
0x12F9000012FF1,
42154155
0x1300000013430,
42164156
0x1344000013456,
4217-
0x13460000143FB,
42184157
0x1440000014647,
4219-
0x161000001613A,
42204158
0x1680000016A39,
42214159
0x16A4000016A5F,
42224160
0x16A6000016A6A,
@@ -4229,8 +4167,6 @@
42294167
0x16B5000016B5A,
42304168
0x16B6300016B78,
42314169
0x16B7D00016B90,
4232-
0x16D4000016D6D,
4233-
0x16D7000016D7A,
42344170
0x16E6000016E80,
42354171
0x16F0000016F4B,
42364172
0x16F4F00016F88,
@@ -4240,7 +4176,7 @@
42404176
0x16FF000016FF2,
42414177
0x17000000187F8,
42424178
0x1880000018CD6,
4243-
0x18CFF00018D09,
4179+
0x18D0000018D09,
42444180
0x1AFF00001AFF4,
42454181
0x1AFF50001AFFC,
42464182
0x1AFFD0001AFFF,
@@ -4255,7 +4191,6 @@
42554191
0x1BC800001BC89,
42564192
0x1BC900001BC9A,
42574193
0x1BC9D0001BC9F,
4258-
0x1CCF00001CCFA,
42594194
0x1CF000001CF2E,
42604195
0x1CF300001CF47,
42614196
0x1DA000001DA37,
@@ -4279,7 +4214,6 @@
42794214
0x1E2900001E2AF,
42804215
0x1E2C00001E2FA,
42814216
0x1E4D00001E4FA,
4282-
0x1E5D00001E5FB,
42834217
0x1E7E00001E7E7,
42844218
0x1E7E80001E7EC,
42854219
0x1E7ED0001E7EF,

0 commit comments

Comments
 (0)