When a ``++System.Globalization.CultureInfo++`` or ``++IFormatProvider++`` object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales.
You should supply culture-specific information according to the following guidelines:
* If the value will be displayed to the user, use the current culture. See ``++CultureInfo.CurrentCulture++``.
* If the value will be stored and accessed by software (persisted to a file or database), use the invariant culture. See ``++CultureInfo.InvariantCulture++``.
* If you do not know the destination of the value, have the data consumer or provider specify the culture.
This rule raises an issue when a method or constructor calls one or more members that have overloads that accept a ``++System.IFormatProvider++`` parameter, and the method or constructor does not call the overload that takes the ``++IFormatProvider++`` parameter. This rule ignores calls to .NET Framework methods that are documented as ignoring the ``++IFormatProvider++`` parameter as well as the following methods:
\[~nicolas.harraudeau] - should we consider https://docs.microsoft.com/en-us/dotnet/api/system.stringcomparison?view=netframework-4.7.2[StringComparison]as well (because is implies CultureInfo)?
=== on 15 Apr 2019, 18:23:22 Nicolas Harraudeau wrote:
Not for now. We need to dig this a little more. Collation issues have usually less impact than encoding issues. We might have to create a separate rule.