Skip to content

Commit 112fa51

Browse files
authored
Unicode 16.0 Support (#111469)
* Unicode 16.0 Support * Update encoding web files * Fix failing test
1 parent dd76387 commit 112fa51

File tree

22 files changed

+1320
-1222
lines changed

22 files changed

+1320
-1222
lines changed

THIRD-PARTY-NOTICES.TXT

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,36 @@ License notice for Unicode data
3434

3535
https://www.unicode.org/license.html
3636

37-
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
37+
Copyright © 1991-2024 Unicode, Inc. All rights reserved.
3838
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
3939

40-
Permission is hereby granted, free of charge, to any person obtaining
41-
a copy of the Unicode data files and any associated documentation
42-
(the "Data Files") or Unicode software and any associated documentation
43-
(the "Software") to deal in the Data Files or Software
44-
without restriction, including without limitation the rights to use,
45-
copy, modify, merge, publish, distribute, and/or sell copies of
46-
the Data Files or Software, and to permit persons to whom the Data Files
47-
or Software are furnished to do so, provided that either
48-
(a) this copyright and permission notice appear with all copies
49-
of the Data Files or Software, or
50-
(b) this copyright and permission notice appear in associated
51-
Documentation.
52-
53-
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
54-
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
55-
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
56-
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
57-
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
58-
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
59-
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
60-
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
61-
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
62-
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
63-
64-
Except as contained in this notice, the name of a copyright holder
65-
shall not be used in advertising or otherwise to promote the sale,
66-
use or other dealings in these Data Files or Software without prior
67-
written authorization of the copyright holder.
40+
Permission is hereby granted, free of charge, to any person obtaining a
41+
copy of data files and any associated documentation (the "Data Files") or
42+
software and any associated documentation (the "Software") to deal in the
43+
Data Files or Software without restriction, including without limitation
44+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
45+
copies of the Data Files or Software, and to permit persons to whom the
46+
Data Files or Software are furnished to do so, provided that either (a)
47+
this copyright and permission notice appear with all copies of the Data
48+
Files or Software, or (b) this copyright and permission notice appear in
49+
associated Documentation.
50+
51+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
52+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
54+
THIRD PARTY RIGHTS.
55+
56+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
57+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
58+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
59+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
60+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
61+
FILES OR SOFTWARE.
62+
63+
Except as contained in this notice, the name of a copyright holder shall
64+
not be used in advertising or otherwise to promote the sale, use or other
65+
dealings in these Data Files or Software without prior written
66+
authorization of the copyright holder.
6867

6968
License notice for zlib-ng
7069
-----------------------

src/libraries/Common/tests/TestUtilities.Unicode/System/Text/Unicode/CodePointFlags.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,9 @@ public enum CodePointFlags : ulong
4747
Unified_Ideograph = 1ul << 31,
4848
Variation_Selector = 1ul << 32,
4949
White_Space = 1ul << 33,
50+
IDS_Unary_Operator = 1ul << 34,
51+
ID_Compat_Math_Continue = 1ul << 35,
52+
ID_Compat_Math_Start = 1ul << 36,
53+
Modifier_Combining_Mark = 1ul << 37,
5054
}
5155
}

src/libraries/Common/tests/TestUtilities.Unicode/System/Text/Unicode/ParsedUnicodeData.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,21 @@ private static Dictionary<int, string> ProcessDerivedNameFile()
137137
{
138138
if (value.IsSingleCodePoint)
139139
{
140-
// Single code point of format "XXXX ; <Name>" (name shouldn't end with '*')
140+
// Single code point of format "XXXX ; <Name>"
141+
// It is possible to get a * at the end of the line, to add one codepoint to previously added range.
142+
// example:
143+
// 18B00..18CD5 ; KHITAN SMALL SCRIPT CHARACTER-* <<<< IsSingleCodePoint is false
144+
// 18CFF ; KHITAN SMALL SCRIPT CHARACTER-* <<<< IsSingleCodePoint is true
141145

142-
Assert.False(value.PropName.EndsWith('*'));
143-
dict.Add(value.FirstCodePoint, value.PropName);
146+
if (value.PropName.EndsWith('*'))
147+
{
148+
string baseName = value.PropName[..^1];
149+
dict.Add(value.FirstCodePoint, $"{baseName}{value.FirstCodePoint:X4}");
150+
}
151+
else
152+
{
153+
dict.Add(value.FirstCodePoint, value.PropName);
154+
}
144155
}
145156
else
146157
{

src/libraries/Common/tests/TestUtilities.Unicode/TestUtilities.Unicode.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4-
<UnicodeUcdVersion>15.0</UnicodeUcdVersion>
4+
<UnicodeUcdVersion>16.0</UnicodeUcdVersion>
55
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
66
</PropertyGroup>
77
<ItemGroup>

src/libraries/System.Private.CoreLib/Tools/GenUnicodeProp/GenUnicodeProp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
55
<OutputType>Exe</OutputType>
6-
<UnicodeUcdVersion>15.0</UnicodeUcdVersion>
6+
<UnicodeUcdVersion>16.0</UnicodeUcdVersion>
77
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
88
<NoWarn>$(NoWarn);CA1416</NoWarn>
99
<EnableDefaultItems>true</EnableDefaultItems>

src/libraries/System.Private.CoreLib/Tools/GenUnicodeProp/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ private static void PrintValueArray<T>(string tableName, Dictionary<T, byte> d,
204204

205205
private static void PrintByteArray(string tableName, StreamWriter file, byte[] str)
206206
{
207-
file.Write("\n private static ReadOnlySpan<byte> " + tableName + " => new byte[" + str.Length + "]\n {\n");
207+
file.Write("\n private static ReadOnlySpan<byte> " + tableName + " => // " + str.Length + "\n [\n");
208208
file.Write(" 0x{0:x2}", str[0]);
209209
for (var i = 1; i < str.Length; i++)
210210
{
211211
file.Write(i % 16 == 0 ? ",\n " : ", ");
212212
file.Write("0x{0:x2}", str[i]);
213213
}
214-
file.Write("\n };\n");
214+
file.Write("\n ];\n");
215215
}
216216

217217
private static void PrintAssertTableLevelsBitCountRoutine(string tableName, StreamWriter file, TableLevels expectedLevels)

0 commit comments

Comments
 (0)