Codepages

 

Codepage is a mapping between numbers and characters.

A set of characters is called charset. A charset typically contains 256 characters and can represent symbols, numbers and one or two alphabets. The majority of printers can print a specific set of charsets.

Normally you will need to deal with codepages and charsets only if you need to print text in languages other than English. For example if you need to print text in Russian you will need to:

  • Set your printer to use one of the Cyrillic character sets. Or check what Cyrillic character set is defined at the moment.

  • Tell TextPrinter to use the codepage of that character set.

  • Pass text for printing in Unicode, or if the default system ANSI codepage is Cyrillic then you can also send text in that default codepage.

You can only use codepages which have been installed. To see a list of installed/ available codepages go to "Regional Options" control panel. In the "Regional Options" control panel you can also define the default ANSI codepage.

Windows provides several pre-defines values that you can use:

Code Meaning
CP_ACP Default ANSI codepage
CP_OEMCP Default OEM codepage
CP_MACCP Default Macintosh codepage
CP_UTF7 UTF7
CP_UTF8 UTF8

Copyright 2004 CodeBuildingBlocks