escpos-ts API - v1.0.0
    Preparing search index...

    Variable CodePagesConst

    CodePages: {
        getCodepageCharList(encoding: string): string[];
        getEncoding(name: string): CodePageEntry;
        getEncodingName(alias: string): string;
    } = ...

    Code-page resolver and character-table builder.

    Resolves encoding aliases, looks up encoding metadata from capabilities.json, and builds the 128-character lookup table (byte values 0x80–0xFF) for any supported code page.

    Type Declaration

    • getCodepageCharList: function
      • Build the 128-character lookup table for byte values 0x80–0xFF in a given code page.

        Two strategies are tried in order:

        1. data array — use the explicit character table bundled in capabilities.json (each entry covers 16 characters; 8 entries total).
        2. iconv-lite — decode each byte 128–255 using the python_encode name via iconv-lite (requires the encoding to be supported).

        Parameters

        • encoding: string

          Encoding name or alias (e.g. "CP437").

        Returns string[]

        Array of 128 single-character strings covering bytes 0x80–0xFF.

        LookupError if neither strategy succeeds for the encoding.

        1.0.0

    • getEncoding: function
    • getEncodingName: function
      • Resolve an encoding alias to its canonical name.

        Handles common variants such as "pc437""CP437", "latin1""ISO-8859-1". Unrecognised inputs are returned uppercased without modification.

        Parameters

        • alias: string

          Encoding name or alias (case-insensitive).

        Returns string

        Canonical encoding name as used in capabilities.json.

        1.0.0

    import { CodePages } from 'escpos-ts';

    const canonical = CodePages.getEncodingName('pc437'); // 'CP437'
    const chars = CodePages.getCodepageCharList('CP437'); // string[128]

    1.0.0