Normalize strings to uppercase

TypeName

NormalizeStringsToUppercase

CheckId

CA1308

Category

Microsoft.Globalization

Breaking Change

Non Breaking

Cause

An operation normalizes string to lowercase.

Rule Description

Strings should be normalized to uppercase. There is a small group of characters that when converted to lowercase cannot make a round trip. To make a round trip means to send the characters from one locale to another one that represents of character data differently, and retrieve it without loss.

How to Fix Violations

Change operations that convert strings to lowercase so that the strings are converted to uppercase instead. For example, change String.ToLower(CultureInfo.InvariantCulture) to String.ToUpper(CultureInfo.InvariantCulture).

When to Suppress Warnings

It is safe to suppress a warning message when you are not making security decision based on the result, for example, when you are displaying it in the UI.

See Also

Other Resources

Globalization Warnings