We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3466394 commit bead643Copy full SHA for bead643
test/UnidecoderTest.cs
@@ -79,5 +79,27 @@ public void UnidecodeOnNullShouldReturnEmptyString()
79
{
80
Assert.Equal("", ((string)null).Unidecode());
81
}
82
- }
+
83
+ /// <summary>
84
+ /// Test that code points with the maximum low byte of 255 do not
85
+ /// cause an IndexOutOfRangeException (see commit: acd8fb4)
86
+ /// </summary>
87
+ [Fact]
88
+ public void MaximumLowByteTest()
89
+ {
90
+ byte low = 0xFF;
91
+ for (var high = (char)0; high <= byte.MaxValue; high++)
92
93
+ var codePoint = (char)((high << 8) | low);
94
+ try
95
96
+ codePoint.Unidecode();
97
+ }
98
+ catch (System.IndexOutOfRangeException)
99
100
+ Assert.True(false);
101
102
103
104
105
0 commit comments