SA1317: Identifier should be named only with Latin letters
Cause
A declared identifier contains a letter other than the basic Latin letters A–Z and a–z.
Rule description
Letters from different alphabets can look identical, making accidental substitutions difficult to notice. This rule checks namespace components, type and member names, parameters and type parameters, local variables, query variables, labels, and explicit tuple element names. It checks declarations rather than references to identifiers.
Only letters are restricted: digits, underscores, and other non-letter characters permitted by C# are unaffected.
Accented Latin letters such as é are not basic Latin letters and are reported.
The @ prefix and Unicode escape sequences are decoded before checking the name.
Each disallowed letter produces a diagnostic on the identifier; the position in the message is a zero-based UTF-16 index in the decoded name, excluding the @ prefix.
For example, the following code would produce a violation of this rule because identifier 'ЕxаmplеClаss' contains non-Latin letters ЕxаmplеClаss:
public class ЕxаmplеClаss {}
The following code would not produce any violations:
public class ExampleClass {}
How to fix violations
To fix a violation of this rule, replace non-Latin letters with appropriate Latin letters. No automatic code fix is provided because the intended replacement cannot be determined reliably.
How to suppress violations
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1317:IdentifierShouldBeNamedOnlyWithLatinLetters", Justification = "Reviewed.")]
#pragma warning disable SA1317 // Identifier should be named only with Latin letters
#pragma warning restore SA1317 // Identifier should be named only with Latin letters