Class to handle data about a particular CodePage, as loaded from the receipt print database.
More...
|
static | generateEncodingArray (string $encodingName) |
| Given an ICU encoding name, generate a 128-entry array, with the unicode code points for the character at positions 128-255 in this code page. More...
|
|
|
| $data |
| Data string, null if not known (can be computed with iconv)
|
|
| $iconv |
| Iconv encoding name, null if not known.
|
|
| $id |
| Internal ID of the CodePage.
|
|
| $name |
| Name of the code page. More...
|
|
| $notes |
| Notes on this code page, or null if not set.
|
|
Class to handle data about a particular CodePage, as loaded from the receipt print database.
Also computes map between UTF-8 and this encoding if necessary, using the intl library.
◆ __construct()
Mike42\Escpos\CodePage::__construct |
( |
|
$id, |
|
|
array |
$codePageData |
|
) |
| |
- Parameters
-
string | $id | Unique internal identifier for the CodePage. |
array | $codePageData | Associative array of CodePage data, as specified by the upstream receipt-print-hq/escpos-printer-db database. May contain 'name', 'data', 'iconv', and 'notes' fields. |
◆ generateEncodingArray()
static Mike42\Escpos\CodePage::generateEncodingArray |
( |
string |
$encodingName | ) |
|
|
staticprotected |
Given an ICU encoding name, generate a 128-entry array, with the unicode code points for the character at positions 128-255 in this code page.
- Parameters
-
string | $encodingName | Name of the encoding |
- Returns
- array 128-entry array of code points
◆ getDataArray()
Mike42\Escpos\CodePage::getDataArray |
( |
| ) |
|
Get a 128-entry array of unicode code-points from this code page.
- Exceptions
-
InvalidArgumentException | Where the data is now known or computable. |
- Returns
- array Data for this encoding.
◆ getIconv()
Mike42\Escpos\CodePage::getIconv |
( |
| ) |
|
- Returns
- string|null Iconv encoding name, or null if not set.
◆ getId()
Mike42\Escpos\CodePage::getId |
( |
| ) |
|
- Returns
- string Unique identifier of the code page.
◆ getName()
Mike42\Escpos\CodePage::getName |
( |
| ) |
|
- Returns
- string Name of the code page.
◆ getNotes()
Mike42\Escpos\CodePage::getNotes |
( |
| ) |
|
The notes may explain quirks about a code-page, such as a source if it's non-standard or un-encodeable.
- Returns
- string|null Notes on the code page, or null if not set.
◆ isEncodable()
Mike42\Escpos\CodePage::isEncodable |
( |
| ) |
|
- Returns
- boolean True if we can encode with this code page (ie, we know what data it holds).
Many printers contain vendor-specific code pages, which are named but have not been identified or typed out. For our purposes, this is an "un-encodeable" code page.
◆ $name
string Mike42\Escpos\CodePage::$name |
|
protected |
Name of the code page.
Substituted with the ID if not set.
◆ MISSING_CHAR_CODE
const Mike42\Escpos\CodePage::MISSING_CHAR_CODE = 0x20 |
Value to use when no character is set.
This is a space in ASCII.
The documentation for this class was generated from the following file:
- src/Mike42/Escpos/CodePage.php