ICultureInfoClass.Invariant

Syntax

Invariant: ICultureInfo;

Description

The Invariant property returns invariant culture settings.

Comments

The invariant culture does not depend on the language and regional parameters, it has the 127 identifier. It is related to the English language, but not to country or region. The invariant culture should be used only for the processes, which require results, regardless of culture, for example, in system services. Invariant should also be used, when a decision, affecting security, is made on the basis of comparing strings or changing the register.

Invariant culture is useful for storing data, which will not be displayed to end users. Storing data in the culture-independent format guarantees a known format, which does not change. When the user from another culture accesses data, it can be formatted in the way that is suitable for this user.

Example

Sub UserProc;
Var
    CF: ICultureInfo;
Begin
    CF := CultureInfo.Invariant;
    Debug.WriteLine(CF.Country);
    Debug.WriteLine(CF.Language);
End Sub UserProc;

On executing the example the console window displays country and language names that correspond to invariant culture.

See also:

ICultureInfoClass