DefaultSystemCodePage

Current system codepage.

Declaration

Source position: systemh.inc line 803

var
  DefaultSystemCodePage : TSystemCodePage;

Description

DefaultSystemCodePage is used to determine how CP_ACP is interpreted; it is what the program considers to be the current system codepage.

It is initialized to the default system codepage.

On windows, this is the result of the GetACP operating call, which returns the Windows ANSI code page. On iOS, this is UTF-8 on other Unixes this will be based on the currently set LANG or LC_CTYPE environment variables. Normally this is UTF-8, but that is not guaranteed to be the case. For all other platforms it is set to CP_ACP, as these platforms currently do not support multiple code pages, and are hardcoded to use their OS-specific code page in all cases.

The DefaultSystemCodePage value may be set using SetMultiByteConversionCodePage . That means that it is not a good idea to use its value to determine the real OS "default system code page".

Note that if you change DefaultSystemCodePage, you should call TEncoding.FreeEncodings to free the encodings that were created. They will be recreated with the correct (new) DefaultSystemCodePage.

See also

Name Description
DefaultFileSystemCodePage Codepage to use for filenames
DefaultRTLFileSystemCodePage Code page in which to return system-returned filenames
DefaultUnicodeCodePage Code page for new unicode strings
TSystemCodePage System code page