Skip to content

Commit 928edb7

Browse files
committed
Update Unicode to verision 17.0.0
1 parent 982f18d commit 928edb7

File tree

8 files changed

+179
-117
lines changed

8 files changed

+179
-117
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ as Unicode IDNA Compatibility Processing. You can read more about the difference
1111
IDNA2008, and UTS#46 in [Section 7. IDNA Comparison](https://www.unicode.org/reports/tr46/#IDNAComparison)
1212
of the specification.
1313

14-
This library currently ships with Unicode 16.0.0 support and implements Version 16.0.0, Revision 31 of IDNA Compatibility
14+
This library currently ships with Unicode 17.0.0 support and implements Version 17.0.0, Revision 35 of IDNA Compatibility
1515
Processing.
1616

1717
* [Requirements](#requirements)
@@ -323,7 +323,7 @@ inside in invalid domains, but your implementation doesn't?**
323323
### Building
324324

325325
Unicode data files are fetched from https://www.unicode.org/Public. Currently, Unicode version
326-
16.0.0-16.0.0 are supported. To change the version of Unicode that the library is built with, you
326+
16.0.0-17.0.0 are supported. To change the version of Unicode that the library is built with, you
327327
must first change the value of the `\Rowbot\Idna::UNICODE_VERSION` constant, like so:
328328

329329
```diff

bin/Builder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ abstract class Builder
2424
*/
2525
protected static function getIdnaDataResource(string $file)
2626
{
27-
$file = sprintf('%s/idna/%s/%s', self::BASE_URL, Idna::UNICODE_VERSION, $file);
27+
$format = match (Idna::UNICODE_VERSION) {
28+
'16.0.0' => '%s/idna/%s/%s', // @phpstan-ignore match.alwaysFalse
29+
default => '%s/%s/idna/%s',
30+
};
31+
$file = sprintf($format, self::BASE_URL, Idna::UNICODE_VERSION, $file);
2832
$handle = fopen($file, 'r');
2933

3034
if ($handle === false) {

resources/DisallowedRanges.php

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ public static function inRange(int $codePoint): bool
2424
return true;
2525
}
2626

27-
if ($codePoint >= 6863 && $codePoint <= 6911) {
28-
return true;
29-
}
30-
3127
if ($codePoint >= 11870 && $codePoint <= 11903) {
3228
return true;
3329
}
@@ -72,7 +68,7 @@ public static function inRange(int $codePoint): bool
7268
return true;
7369
}
7470

75-
if ($codePoint >= 67904 && $codePoint <= 67967) {
71+
if ($codePoint >= 67930 && $codePoint <= 67967) {
7672
return true;
7773
}
7874

@@ -92,7 +88,7 @@ public static function inRange(int $codePoint): bool
9288
return true;
9389
}
9490

95-
if ($codePoint >= 69317 && $codePoint <= 69371) {
91+
if ($codePoint >= 69337 && $codePoint <= 69369) {
9692
return true;
9793
}
9894

@@ -124,15 +120,19 @@ public static function inRange(int $codePoint): bool
124120
return true;
125121
}
126122

127-
if ($codePoint >= 72458 && $codePoint <= 72639) {
123+
if ($codePoint >= 72458 && $codePoint <= 72543) {
124+
return true;
125+
}
126+
127+
if ($codePoint >= 72552 && $codePoint <= 72639) {
128128
return true;
129129
}
130130

131131
if ($codePoint >= 72887 && $codePoint <= 72959) {
132132
return true;
133133
}
134134

135-
if ($codePoint >= 73130 && $codePoint <= 73439) {
135+
if ($codePoint >= 73194 && $codePoint <= 73439) {
136136
return true;
137137
}
138138

@@ -164,7 +164,7 @@ public static function inRange(int $codePoint): bool
164164
return true;
165165
}
166166

167-
if ($codePoint >= 93851 && $codePoint <= 93951) {
167+
if ($codePoint >= 93908 && $codePoint <= 93951) {
168168
return true;
169169
}
170170

@@ -176,19 +176,19 @@ public static function inRange(int $codePoint): bool
176176
return true;
177177
}
178178

179-
if ($codePoint >= 101641 && $codePoint <= 110575) {
179+
if ($codePoint >= 101663 && $codePoint <= 101759) {
180180
return true;
181181
}
182182

183-
if ($codePoint >= 111356 && $codePoint <= 113663) {
183+
if ($codePoint >= 101875 && $codePoint <= 110575) {
184184
return true;
185185
}
186186

187-
if ($codePoint >= 113828 && $codePoint <= 117759) {
187+
if ($codePoint >= 111356 && $codePoint <= 113663) {
188188
return true;
189189
}
190190

191-
if ($codePoint >= 118452 && $codePoint <= 118527) {
191+
if ($codePoint >= 113828 && $codePoint <= 117759) {
192192
return true;
193193
}
194194

@@ -232,7 +232,11 @@ public static function inRange(int $codePoint): bool
232232
return true;
233233
}
234234

235-
if ($codePoint >= 124416 && $codePoint <= 124895) {
235+
if ($codePoint >= 124416 && $codePoint <= 124607) {
236+
return true;
237+
}
238+
239+
if ($codePoint >= 124672 && $codePoint <= 124895) {
236240
return true;
237241
}
238242

@@ -268,11 +272,11 @@ public static function inRange(int $codePoint): bool
268272
return true;
269273
}
270274

271-
if ($codePoint >= 129218 && $codePoint <= 129279) {
275+
if ($codePoint >= 129241 && $codePoint <= 129279) {
272276
return true;
273277
}
274278

275-
if ($codePoint >= 130042 && $codePoint <= 131069) {
279+
if ($codePoint >= 130043 && $codePoint <= 131069) {
276280
return true;
277281
}
278282

@@ -288,7 +292,7 @@ public static function inRange(int $codePoint): bool
288292
return true;
289293
}
290294

291-
if ($codePoint >= 205744 && $codePoint <= 262141) {
295+
if ($codePoint >= 210042 && $codePoint <= 262141) {
292296
return true;
293297
}
294298

resources/Regex.php

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)