[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'System' (#rtl)

# DefaultSystemCodePage

Current system codepage.

## Declaration

Source position: systemh.inc line 722

`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

DefaultUnicodeCodePage |  | Code page for new unicode strings
DefaultFileSystemCodePage |  | Codepage to use for filenames
DefaultRTLFileSystemCodePage |  | Code page in which to return system-returned filenames