Skip to content

Commit 17c7414

Browse files
Initial commit for System.Text.Rune (dotnet/coreclr#20935)
This type represents a Unicode scalar value ([ U+0000..U+D7FF ], inclusive; and [ U+E000..U+10FFFF ], inclusive). The primary scenario is for having a consistent representation of Unicode data regardless of the underlying input encoding type, including abstracting away surrogate code points. Commit migrated from dotnet/coreclr@7fcd8a8
1 parent e4af9b4 commit 17c7414

File tree

6 files changed

+977
-0
lines changed

6 files changed

+977
-0
lines changed

src/coreclr/src/System.Private.CoreLib/Resources/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3652,6 +3652,9 @@
36523652
<data name="Argument_MethodRedefined" xml:space="preserve">
36533653
<value>Method has been already defined.</value>
36543654
</data>
3655+
<data name="Argument_CannotExtractScalar" xml:space="preserve">
3656+
<value>Cannot extract a Unicode scalar value from the specified index in the input.</value>
3657+
</data>
36553658
<data name="Argument_CannotParsePrecision" xml:space="preserve">
36563659
<value>Characters following the format symbol must be a number of {0} or less.</value>
36573660
</data>

src/coreclr/src/System.Private.CoreLib/src/System/ThrowHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ internal static void ThrowArgumentException_OverlapAlignmentMismatch()
7676
throw new ArgumentException(SR.Argument_OverlapAlignmentMismatch);
7777
}
7878

79+
internal static void ThrowArgumentException_CannotExtractScalar(ExceptionArgument argument)
80+
{
81+
throw GetArgumentException(ExceptionResource.Argument_CannotExtractScalar, argument);
82+
}
83+
7984
internal static void ThrowArgumentOutOfRange_IndexException()
8085
{
8186
throw GetArgumentOutOfRangeException(ExceptionArgument.index,
@@ -490,6 +495,7 @@ internal enum ExceptionArgument
490495
pHandle,
491496
values,
492497
task,
498+
ch,
493499
s,
494500
input,
495501
pointer,
@@ -528,6 +534,7 @@ internal enum ExceptionResource
528534
ArgumentOutOfRange_Index,
529535
Argument_InvalidOffLen,
530536
Argument_ItemNotExist,
537+
Argument_CannotExtractScalar,
531538
ArgumentOutOfRange_Count,
532539
ArgumentOutOfRange_InvalidThreshold,
533540
ArgumentOutOfRange_ListInsert,

src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,12 @@
651651
<Compile Include="$(MSBuildThisFileDirectory)System\Text\EncodingProvider.cs" />
652652
<Compile Include="$(MSBuildThisFileDirectory)System\Text\Latin1Encoding.cs" />
653653
<Compile Include="$(MSBuildThisFileDirectory)System\Text\NormalizationForm.cs" />
654+
<Compile Include="$(MSBuildThisFileDirectory)System\Text\Rune.cs" />
654655
<Compile Include="$(MSBuildThisFileDirectory)System\Text\StringBuilder.cs" />
655656
<Compile Include="$(MSBuildThisFileDirectory)System\Text\StringBuilder.Debug.cs" Condition="'$(Configuration)' == 'Debug'" />
657+
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UnicodeDebug.cs" />
656658
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UnicodeEncoding.cs" />
659+
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UnicodeUtility.cs" />
657660
<Compile Include="$(MSBuildThisFileDirectory)System\Text\Utf16Utility.cs" />
658661
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UTF32Encoding.cs" />
659662
<Compile Include="$(MSBuildThisFileDirectory)System\Text\UTF7Encoding.cs" />

0 commit comments

Comments
 (0)