PHP Класс Mike42\Escpos\CodePage

Also computes map between UTF-8 and this encoding if necessary, using the iconv library.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
generateEncodingMap ( string $iconvName ) : string Given an iconv encoding name, generate a 128-character UTF-8 string, containing code points 128-255.

Описание методов

__construct() публичный Метод

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.

generateEncodingMap() защищенный статический Метод

This string is used to map UTF-8 characters to their location in this code page.
protected static generateEncodingMap ( string $iconvName ) : string
$iconvName string Name of the encoding
Результат string 128-character string in UTF-8.

getData() публичный Метод

It will be calculated and cached if it was not previously known.
public getData ( ) : string
Результат string Data for this encoding.

getIconv() публичный Метод

public getIconv ( ) : string
Результат string Iconv encoding name, or blank if not set.

getId() публичный Метод

public getId ( ) : string
Результат string Unique identifier of the code page.

getName() публичный Метод

Name of the code page.
public getName ( )

getNotes() публичный Метод

The notes may explain quirks about a code-page, such as a source if it's non-standard or un-encodeable.
public getNotes ( ) : string
Результат string Notes on the code page, or null if not set.

isEncodable() публичный Метод

public isEncodable ( ) : boolean
Результат 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.

Описание свойств

$data защищенное свойство

Data string, null if not known (can be computed with iconv)
protected string $data
Результат string

$iconv защищенное свойство

Iconv encoding name, null if not known
protected string $iconv
Результат string

$id защищенное свойство

Internal ID of the CodePage
protected string $id
Результат string

$name защищенное свойство

Name of the code page. Substituted with the ID if not set.
protected string $name
Результат string

$notes защищенное свойство

Notes on this code page, or null if not set.
protected string $notes
Результат string