Skip to content

Commit 6a3f6a0

Browse files
BCSharpslozier
authored andcommitted
Fix debug check of codecs names
1 parent 0be3c1c commit 6a3f6a0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Src/IronPython/Runtime/Operations/StringOps.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,7 +2079,9 @@ static CodecsInfo() {
20792079
#if DEBUG
20802080
foreach (KeyValuePair<string, Lazy<Encoding?>> kvp in d) {
20812081
// all codecs should be stored in lowercase because we only look up from lowercase strings
2082-
Debug.Assert(kvp.Key.Equals(kvp.Key, StringComparison.OrdinalIgnoreCase));
2082+
#pragma warning disable CA1862 // disable warning about comparing with ToLower()
2083+
Debug.Assert(kvp.Key.ToLower(CultureInfo.InvariantCulture) == kvp.Key);
2084+
#pragma warning restore
20832085
// all codec names should use underscores instead of dashes to match lookup values
20842086
Debug.Assert(kvp.Key.IndexOf('-') < 0);
20852087
}

0 commit comments

Comments
 (0)