[Up][Next] Reference for unit 'System' (#rtl)

Unicode and codepage support

The system unit works with Short-, Ansi-, and UnicodeString routines for all string related operations.

Ansistrings are code-page aware, which means that code page information is associated with them. For most routines, the support for converting these code pages is natural. For some routines, care must be taken when converting from codepage-aware strings to widestring.

The codepage conversion support is influenced by the following variables:

Name Description
DefaultSystemCodePage Actual code page to use when CP_ACP is encountered
DefaultUnicodeCodePage Code page for new unicode strings
DefaultFileSystemCodePage Codepage to use when sending strings to single-byte OS filesystem routines.
DefaultRTLFileSystemCodePage Codepage to use when receiving strings from single-byte OS filesystem routines.

The windows code page identifiers are used. There are 3 special codepage identifiers:

Name Description
CP_ACP Currently set default syststem cpdepage
CP_OEMCP OEM (console) code page (only on windows)
CP_NONE Indicates absence of code page information for a string
DefaultRTLFileSystemCodePage

The following routines may perform code page conversions:

Name Description
LowerCase Return lowercase version of a string.
UpCase Convert a string to all uppercase.
GetDir Return the current directory
MkDir Create a new directory.
ChDir Change current working directory.
RmDir Remove directory when empty.
Assign Assign a name to a file
Erase Delete a file from disk
Rename Rename file on disk
Read Read from a text file into variable
ReadLn Read from a text file into variable and goto next line
Write Write variable to a text file
WriteLn Write variable to a text file and append newline
ReadStr Read variables from a string
WriteStr Write variables to a string
Insert Insert one string in another.
Copy Copy part of a string.
Delete Delete part of a string.
SetString Set length of a string and copy buffer.

All these routines exist also in Unicode versions.

Note that for conversion of codepages and unicode strings, a unicode manager must be present. On windows, the system is used for this. On Unix, one of the fpwidestring or cwstring units must be used.


Documentation generated on: Mar 17 2017