Skip to main content

Crate copybook_charset

Crate copybook_charset 

Source
Expand description

Character set conversion utilities for EBCDIC ↔ UTF-8.

Provides bidirectional conversion between five IBM EBCDIC codepages and Unicode/UTF-8 using compile-time lookup tables for maximum throughput.

§Supported Codepages

CodepageRegion
CP 037US / Canada
CP 273Germany / Austria
CP 500International Latin-1
CP 1047Latin-1 / Open Systems
CP 1140US / Canada with €

§Key Functions

Both functions accept an UnmappablePolicy that controls behaviour when a character has no mapping in the target encoding (replace with a substitute character or return an error).

Enums§

Codepage
Character encoding specification
UnmappablePolicy
Policy for handling unmappable characters during decode

Functions§

ebcdic_to_utf8
Convert EBCDIC bytes to UTF-8 string
get_zoned_sign_table
Get zoned decimal sign table for a codepage.
space_byte
Get the space byte value for a codepage.
utf8_to_ebcdic
Convert UTF-8 string to EBCDIC bytes