Skip to content

Function: defineSingleBytePage() ​

ts
function defineSingleBytePage(names, table): CharsetPage;

Defined in: packages/core/src/charset/pages.ts:60

Builds a complete single-byte CharsetPage from a 256-character table: table[b] is the character byte b decodes to; U+FFFD marks a byte the codepage leaves undefined (decodes to U+FFFD in 'replace' mode, throws in 'strict', and never enters the reverse map).

Everything else is computed from the table, never declared: which bytes are identity (drives the scan-then-native-latin1 fast path — a page like DOS864 that remaps 0x25 below 0x80 is handled automatically), the reverse map (built lazily on first non-trivial encode), and strict-mode validity.

Parameters ​

ParameterType
namesstring | string[]
tablestring

Returns ​

CharsetPage

MIT Licensed. Contains data derived from the Firebird project under IDPL/IPL.