Sign in Join
Wiki copytemporary

$codePage: what changed

Revision 3 to 4. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11The [[global compiler directives|global compiler directive]] `{$codePage}` indicates how to interpret [[string]] literals.
22
33## available code pages
44
55The [[FPC]] can understand following code pages:
66
7-<thead>
8-
9-</thead>
10-<tbody>
11-
12-<code>{$codePage UTF8}</code></td>
13-
14-</tbody>
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 |
1528
1629The 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).
1730
1831## use
1932
2033Since [[FPC New Features 3.0.0|FPC 3.0.0]] every [[Ansistring|ANSIString]] is associated with a CP.
2134
2235## see also
2336
2437- [[FPC Unicode support|FPC Unicode support § “source file code page”]]
2538- [“`$CODEPAGE`: Set the source codepage”](https://freepascal.org/docs-html/current/prog/progsu88.html)
2639- [[Language Codes]]
2740
2841---
2942*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).*
3043Category: Global compiler directives

Back to history