Korin API

AnselCodec
in package
implements Codec

Read onlyYes
FinalYes

ANSEL (ANSI/NISO Z39.47) with the GEDCOM 5.5 additions (empty and black box, midline e and o, es zet; "LDS extensions"). Combining marks precede the base letter in ANSEL and follow it in Unicode; decoded text is NFC.

Table of Contents

Interfaces

Codec
Converts between one character encoding and UTF-8.

Constants

COMBINING  : mixed = [0xe0 => "̉", 0xe1 => "̀", 0xe2 => "́", 0xe3 => "̂"...
Combining marks, byte → UTF-8 of the Unicode combining character.
SPACING  : mixed = [0xa1 => 'Ł', 0xa2 => 'Ø', 0xa3 => 'Đ', 0xa4 =>...
Spacing characters, byte → UTF-8.

Methods

__construct()  : mixed
decode()  : string|null
Decodes to UTF-8, or returns null when the bytes are not valid in this encoding.
decodeLossy()  : string
Decodes to UTF-8, replacing every invalid or undefined sequence with U+FFFD.
encode()  : string

Constants

COMBINING

Combining marks, byte → UTF-8 of the Unicode combining character.

public mixed COMBINING = [0xe0 => "̉", 0xe1 => "̀", 0xe2 => "́", 0xe3 => "̂", 0xe4 => "̃", 0xe5 => "̄", 0xe6 => "̆", 0xe7 => "̇", 0xe8 => "̈", 0xe9 => "̌", 0xea => "̊", 0xeb => "︠", 0xec => "︡", 0xed => "̕", 0xee => "̋", 0xef => "̐", 0xf0 => "̧", 0xf1 => "̨", 0xf2 => "̣", 0xf3 => "̤", 0xf4 => "̥", 0xf5 => "̳", 0xf6 => "̲", 0xf7 => "̦", 0xf8 => "̜", 0xf9 => "̮", 0xfa => "︢", 0xfb => "︣", 0xfe => "̓"]

SPACING

Spacing characters, byte → UTF-8.

public mixed SPACING = [0xa1 => 'Ł', 0xa2 => 'Ø', 0xa3 => 'Đ', 0xa4 => 'Þ', 0xa5 => 'Æ', 0xa6 => 'Œ', 0xa7 => 'ʹ', 0xa8 => '·', 0xa9 => '♭', 0xaa => '®', 0xab => '±', 0xac => 'Ơ', 0xad => 'Ư', 0xae => 'ʼ', 0xb0 => 'ʻ', 0xb1 => 'ł', 0xb2 => 'ø', 0xb3 => 'đ', 0xb4 => 'þ', 0xb5 => 'æ', 0xb6 => 'œ', 0xb7 => 'ʺ', 0xb8 => 'ı', 0xb9 => '£', 0xba => 'ð', 0xbc => 'ơ', 0xbd => 'ư', 0xc0 => '°', 0xc1 => 'ℓ', 0xc2 => '℗', 0xc3 => '©', 0xc4 => '♯', 0xc5 => '¿', 0xc6 => '¡', 0xcf => 'ß', 0xbe => '□', 0xbf => '■']

Methods

__construct()

public __construct([bool $useIntl = true ]) : mixed
Parameters
$useIntl : bool = true

use ext-intl Normalizer when available; false forces the bundled tables

decode()

Decodes to UTF-8, or returns null when the bytes are not valid in this encoding.

public decode(string $bytes) : string|null
Parameters
$bytes : string
Return values
string|null

decodeLossy()

Decodes to UTF-8, replacing every invalid or undefined sequence with U+FFFD.

public decodeLossy(string $bytes) : string
Parameters
$bytes : string
Return values
string

encode()

public encode(string $utf8) : string
Parameters
$utf8 : string
Return values
string
On this page

Search results