Property | Type | Description | |
---|---|---|---|
$data | string | Data string, null if not known (can be computed with iconv) | |
$iconv | string | Iconv encoding name, null if not known | |
$id | string | Internal ID of the CodePage | |
$name | string | Name of the code page. Substituted with the ID if not set. | |
$notes | string | Notes on this code page, or null if not set. |
Method | Description | |
---|---|---|
__construct ( string $id, array $codePageData ) | ||
getData ( ) : string | Get a 128-character data string representing this encoding. | |
getIconv ( ) : string | ||
getId ( ) : string | ||
getName ( ) | Name of the code page. | |
getNotes ( ) : string | The notes may explain quirks about a code-page, such as a source if it's non-standard or un-encodeable. | |
isEncodable ( ) : boolean |
Method | Description | |
---|---|---|
generateEncodingMap ( string $iconvName ) : string | Given an iconv encoding name, generate a 128-character UTF-8 string, containing code points 128-255. |
public __construct ( string $id, array $codePageData ) | ||
$id | string | Unique internal identifier for the CodePage. |
$codePageData | array | 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. |
protected static generateEncodingMap ( string $iconvName ) : string | ||
$iconvName | string | Name of the encoding |
return | string | 128-character string in UTF-8. |
public isEncodable ( ) : boolean | ||
return | 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. |
protected string $data | ||
return | string |
protected string $iconv | ||
return | string |
protected string $name | ||
return | string |
protected string $notes | ||
return | string |