diff options
author | Nobuyuki Iwanaga <ufcpp@live.jp> | 2018-01-20 08:29:32 +0900 |
---|---|---|
committer | Tarek Mahmoud Sayed <tarekms@microsoft.com> | 2018-01-19 15:29:32 -0800 |
commit | 11bca94b4b0374ee8f1e4ec28d7140abf4521583 (patch) | |
tree | f1a5cb9e232708e81a9b40c9b544057e2d11f1b1 /src | |
parent | 7f8c67e5fa17aace876612942979cbec8b78229e (diff) | |
download | coreclr-11bca94b4b0374ee8f1e4ec28d7140abf4521583.tar.gz coreclr-11bca94b4b0374ee8f1e4ec28d7140abf4521583.tar.bz2 coreclr-11bca94b4b0374ee8f1e4ec28d7140abf4521583.zip |
CharUnicodeInfo.GetUnicodeCategory(int codePoint) (#15911)
* CharUnicodeInfo.GetUnicodeCategory(int codePoint)
https://github.com/dotnet/corefx/issues/26173
- renamed UnicodeCategory.InternalGetUnicodeCategory to GetUnicodeCategory
- renamed its parameter ch to codePoint
- made it public
* fix build break
Diffstat (limited to 'src')
-rw-r--r-- | src/mscorlib/shared/System/Char.cs | 2 | ||||
-rw-r--r-- | src/mscorlib/shared/System/Globalization/CharUnicodeInfo.cs | 10 | ||||
-rw-r--r-- | src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/mscorlib/shared/System/Char.cs b/src/mscorlib/shared/System/Char.cs index 6059830fbd..179ac40282 100644 --- a/src/mscorlib/shared/System/Char.cs +++ b/src/mscorlib/shared/System/Char.cs @@ -853,7 +853,7 @@ namespace System { return (GetLatin1UnicodeCategory(c)); } - return CharUnicodeInfo.InternalGetUnicodeCategory(c); + return CharUnicodeInfo.GetUnicodeCategory((int)c); } public static UnicodeCategory GetUnicodeCategory(String s, int index) diff --git a/src/mscorlib/shared/System/Globalization/CharUnicodeInfo.cs b/src/mscorlib/shared/System/Globalization/CharUnicodeInfo.cs index 3881272287..0cd8429bbc 100644 --- a/src/mscorlib/shared/System/Globalization/CharUnicodeInfo.cs +++ b/src/mscorlib/shared/System/Globalization/CharUnicodeInfo.cs @@ -276,7 +276,7 @@ namespace System.Globalization public static UnicodeCategory GetUnicodeCategory(char ch) { - return (InternalGetUnicodeCategory(ch)); + return (GetUnicodeCategory((int)ch)); } public static UnicodeCategory GetUnicodeCategory(String s, int index) @@ -290,9 +290,9 @@ namespace System.Globalization return InternalGetUnicodeCategory(s, index); } - internal static unsafe UnicodeCategory InternalGetUnicodeCategory(int ch) + public static UnicodeCategory GetUnicodeCategory(int codePoint) { - return ((UnicodeCategory)InternalGetCategoryValue(ch, UNICODE_CATEGORY_OFFSET)); + return ((UnicodeCategory)InternalGetCategoryValue(codePoint, UNICODE_CATEGORY_OFFSET)); } @@ -352,7 +352,7 @@ namespace System.Globalization Debug.Assert(value != null, "value can not be null"); Debug.Assert(index < value.Length, "index < value.Length"); - return (InternalGetUnicodeCategory(InternalConvertToUtf32(value, index))); + return (GetUnicodeCategory(InternalConvertToUtf32(value, index))); } internal static BidiCategory GetBidiCategory(String s, int index) @@ -381,7 +381,7 @@ namespace System.Globalization Debug.Assert(str.Length > 0, "str.Length > 0"); ; Debug.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); - return (InternalGetUnicodeCategory(InternalConvertToUtf32(str, index, out charLength))); + return (GetUnicodeCategory(InternalConvertToUtf32(str, index, out charLength))); } internal static bool IsCombiningCategory(UnicodeCategory uc) diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs index 7fbd49f656..19e358804f 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs +++ b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs @@ -329,7 +329,7 @@ namespace System.Globalization if (index == length - 1 || !Char.IsLowSurrogate(text[index+1])) return false; // unpaired surrogate - uc = CharUnicodeInfo.InternalGetUnicodeCategory(Char.ConvertToUtf32(text[index], text[index+1])); + uc = CharUnicodeInfo.GetUnicodeCategory(Char.ConvertToUtf32(text[index], text[index+1])); if (uc == UnicodeCategory.PrivateUse || uc == UnicodeCategory.OtherNotAssigned) return false; |