$codePage: what changed
Revision 3 to 4. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | The [[global compiler directives|global compiler directive]] `{$codePage}` indicates how to interpret [[string]] literals. | |
| 2 | 2 | ||
| 3 | 3 | ## available code pages | |
| 4 | 4 | ||
| 5 | 5 | The [[FPC]] can understand following code pages: | |
| 6 | 6 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 7 | + | | code page | description | | |
| 8 | + | |---|---| | |
| 9 | + | | `{$codePage CP437}` | Original IBM PC or DOS Latin US [code page 437](https://en.wikipedia.org/wiki/Code_page_437) | | |
| 10 | + | | `{$codePage CP850}` | DOS Latin 1 [code page 850](https://en.wikipedia.org/wiki/Code_page_850) | | |
| 11 | + | | `{$codePage CP852}` | DOS Latin 2 [code page 852](https://en.wikipedia.org/wiki/Code_page_852) | | |
| 12 | + | | `{$codePage CP856}` | Hebrew, [code page 856](https://en.wikipedia.org/wiki/Code_page_856) | | |
| 13 | + | | `{$codePage CP866}` | Cyrillic script, [code page 866](https://en.wikipedia.org/wiki/Code_page_866) | | |
| 14 | + | | `{$codePage CP874}` | Thai, [ISO/IEC 8859‑11](https://en.wikipedia.org/wiki/Code_page_874) | | |
| 15 | + | | `{$codePage CP1250}` | [Windows‑1250](https://en.wikipedia.org/wiki/Windows-1250) | | |
| 16 | + | | `{$codePage CP1251}` | Cyrillic script, [Windows‑1251](https://en.wikipedia.org/wiki/Windows-1251) | | |
| 17 | + | | `{$codePage CP1252}` | [Windows‑1252](https://en.wikipedia.org/wiki/Windows-1252) | | |
| 18 | + | | `{$codePage CP1253}` | Greek script, [Windows‑1253](https://en.wikipedia.org/wiki/Windows-1253) | | |
| 19 | + | | `{$codePage CP1254}` | Turkish, [Windows‑1254](https://en.wikipedia.org/wiki/Windows-1254) | | |
| 20 | + | | `{$codePage CP1255}` | Hebrew, [Windows‑1255](https://en.wikipedia.org/wiki/Windows-1255) | | |
| 21 | + | | `{$codePage CP1256}` | Arabic, [Windows‑1256](https://en.wikipedia.org/wiki/Windows-1256) | | |
| 22 | + | | `{$codePage CP1257}` | [Windows‑1257](https://en.wikipedia.org/wiki/Windows-1257) | | |
| 23 | + | | `{$codePage CP1258}` | Vietnamese, [Windows-1258](https://en.wikipedia.org/wiki/Windows-1258) | | |
| 24 | + | | `{$codePage 8859-1}` | ISO Latin-1, [ISO/IEC 8859‑1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) | | |
| 25 | + | | `{$codePage 8859-2}` | [ISO/IEC 8859‑2](https://en.wikipedia.org/wiki/ISO/IEC_8859-2) | | |
| 26 | + | | `{$codePage 8859-5}` | Cyrillic script, [ISO/IEC 8859‑5](https://en.wikipedia.org/wiki/ISO/IEC_8859-5) | | |
| 27 | + | | `{$codePage UTF-8}` · `{$codePage UTF8}` | pseudo code page to switch back to UTF-8 | | |
| 15 | 28 | ||
| 16 | 29 | 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). | |
| 17 | 30 | ||
| 18 | 31 | ## use | |
| 19 | 32 | ||
| 20 | 33 | Since [[FPC New Features 3.0.0|FPC 3.0.0]] every [[Ansistring|ANSIString]] is associated with a CP. | |
| 21 | 34 | ||
| 22 | 35 | ## see also | |
| 23 | 36 | ||
| 24 | 37 | - [[FPC Unicode support|FPC Unicode support § “source file code page”]] | |
| 25 | 38 | - [“`$CODEPAGE`: Set the source codepage”](https://freepascal.org/docs-html/current/prog/progsu88.html) | |
| 26 | 39 | - [[Language Codes]] | |
| 27 | 40 | ||
| 28 | 41 | --- | |
| 29 | 42 | *From the Free Pascal wiki, page "$codePage", as it stood on 2023-11-11 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 30 | 43 | Category: Global compiler directives |
