Difference between revisions of "$codePage"
From Free Pascal wiki
Jump to navigationJump to search (create) |
(→available code pages: added aliases for some codepages) |
||
Line 7: | Line 7: | ||
|- | |- | ||
| <syntaxhighlight lang="pascal" inline>{$codePage CP437}</syntaxhighlight> | | <syntaxhighlight lang="pascal" inline>{$codePage CP437}</syntaxhighlight> | ||
− | | [https://en.wikipedia.org/wiki/Code_page_437 code page 437] | + | | Original IBM PC or DOS Latin US [https://en.wikipedia.org/wiki/Code_page_437 code page 437] |
|- | |- | ||
| <syntaxhighlight lang="pascal" inline>{$codePage CP850}</syntaxhighlight> | | <syntaxhighlight lang="pascal" inline>{$codePage CP850}</syntaxhighlight> | ||
− | | [https://en.wikipedia.org/wiki/Code_page_850 code page 850] | + | | DOS Latin 1 [https://en.wikipedia.org/wiki/Code_page_850 code page 850] |
|- | |- | ||
| <syntaxhighlight lang="pascal" inline>{$codePage CP852}</syntaxhighlight> | | <syntaxhighlight lang="pascal" inline>{$codePage CP852}</syntaxhighlight> | ||
− | | [https://en.wikipedia.org/wiki/Code_page_852 code page 852] | + | | DOS Latin 2 [https://en.wikipedia.org/wiki/Code_page_852 code page 852] |
|- | |- | ||
| <syntaxhighlight lang="pascal" inline>{$codePage CP856}</syntaxhighlight> | | <syntaxhighlight lang="pascal" inline>{$codePage CP856}</syntaxhighlight> | ||
Line 52: | Line 52: | ||
|- | |- | ||
| <syntaxhighlight lang="pascal" inline>{$codePage 8859-1}</syntaxhighlight> | | <syntaxhighlight lang="pascal" inline>{$codePage 8859-1}</syntaxhighlight> | ||
− | | Latin-1, [https://en.wikipedia.org/wiki/ISO/IEC_8859-1 ISO/IEC 8859‑1] | + | | ISO Latin-1, [https://en.wikipedia.org/wiki/ISO/IEC_8859-1 ISO/IEC 8859‑1] |
|- | |- | ||
| <syntaxhighlight lang="pascal" inline>{$codePage 8859-2}</syntaxhighlight> | | <syntaxhighlight lang="pascal" inline>{$codePage 8859-2}</syntaxhighlight> |
Latest revision as of 19:42, 11 November 2023
The global compiler directive {$codePage}
indicates how to interpret string literals.
available code pages
The FPC can understand following code pages:
code page | description |
---|---|
{$codePage CP437}
|
Original IBM PC or DOS Latin US code page 437 |
{$codePage CP850}
|
DOS Latin 1 code page 850 |
{$codePage CP852}
|
DOS Latin 2 code page 852 |
{$codePage CP856}
|
Hebrew, code page 856 |
{$codePage CP866}
|
Cyrillic script, code page 866 |
{$codePage CP874}
|
Thai, ISO/IEC 8859‑11 |
{$codePage CP1250}
|
Windows‑1250 |
{$codePage CP1251}
|
Cyrillic script, Windows‑1251 |
{$codePage CP1252}
|
Windows‑1252 |
{$codePage CP1253}
|
Greek script, Windows‑1253 |
{$codePage CP1254}
|
Turkish, Windows‑1254 |
{$codePage CP1255}
|
Hebrew, Windows‑1255 |
{$codePage CP1256}
|
Arabic, Windows‑1256 |
{$codePage CP1257}
|
Windows‑1257 |
{$codePage CP1258}
|
Vietnamese, Windows-1258 |
{$codePage 8859-1}
|
ISO Latin-1, ISO/IEC 8859‑1 |
{$codePage 8859-2}
|
ISO/IEC 8859‑2 |
{$codePage 8859-5}
|
Cyrillic script, ISO/IEC 8859‑5 |
{$codePage UTF-8} {$codePage UTF8}
|
pseudo code page to switch back to UTF-8 |
The code page can be selected either via a compiler directive or as a command-line parameter: ‑Fc…
(where …
is one of the code page names listed above).
use
Since FPC 3.0.0 every ANSIString
is associated with a CP.