Fix ascii range check (#16535)
authorBen Adams <thundercat@illyriad.co.uk>
Tue, 27 Feb 2018 01:23:56 +0000 (01:23 +0000)
committerAhson Khan <ahkha@microsoft.com>
Tue, 27 Feb 2018 01:23:56 +0000 (17:23 -0800)
src/mscorlib/shared/System/Globalization/CompareInfo.cs
src/mscorlib/src/System/String.Comparison.cs

index 8dbfed1..c369c81 100644 (file)
@@ -566,7 +566,7 @@ namespace System.Globalization
                 char* b = bp;
 
                 // in InvariantMode we support all range and not only the ascii characters.
-                char maxChar = (char) (GlobalizationMode.Invariant ? 0xFFFF : 0x80);
+                char maxChar = (char) (GlobalizationMode.Invariant ? 0xFFFF : 0x7F);
 
                 while (length != 0 && (*a <= maxChar) && (*b <= maxChar))
                 {
index 9bd907f..44b3ed9 100644 (file)
@@ -65,7 +65,7 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         internal static extern int CompareOrdinalHelper(String strA, int indexA, int countA, String strB, int indexB, int countB);
 
-        //This will not work in case-insensitive mode for any character greater than 0x80.  
+        //This will not work in case-insensitive mode for any character greater than 0x7F.  
         //We'll throw an ArgumentException.
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         unsafe internal static extern int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes);