Raxol.Terminal.ANSI.CharacterTranslations (Raxol v0.4.0)

View Source

Provides character translation tables for different character sets. Maps characters between different character sets according to ANSI standards.

Summary

Functions

Returns the DEC Special Graphics character set translation table.

Returns the DEC Supplementary character set translation table.

Returns the DEC Supplementary Graphics character set translation table.

Returns the DEC Technical character set translation table.

Returns the French character set translation table.

Returns the German character set translation table.

Returns the Latin-1 character set translation table.

Translates a character from the source character set to the target character set. Returns the translated character as a UTF-8 binary or the original if no translation exists.

Translates a string from the source character set to the target character set. Handles invalid bytes gracefully by passing them through as-is.

Returns the UK character set translation table.

Map of Unicode codepoints to their ANSI terminal equivalents.

Returns the US ASCII character set translation table.

Functions

dec_special()

Returns the DEC Special Graphics character set translation table.

dec_supplementary()

Returns the DEC Supplementary character set translation table.

dec_supplementary_graphics()

Returns the DEC Supplementary Graphics character set translation table.

dec_technical()

Returns the DEC Technical character set translation table.

french()

Returns the French character set translation table.

german()

Returns the German character set translation table.

latin1()

Returns the Latin-1 character set translation table.

translate_char(char, charset)

@spec translate_char(char_codepoint :: integer(), charset :: atom()) :: binary()

Translates a character from the source character set to the target character set. Returns the translated character as a UTF-8 binary or the original if no translation exists.

translate_string(string, charset)

@spec translate_string(string :: String.t(), charset :: atom()) :: String.t()

Translates a string from the source character set to the target character set. Handles invalid bytes gracefully by passing them through as-is.

uk()

Returns the UK character set translation table.

unicode_to_ansi()

Map of Unicode codepoints to their ANSI terminal equivalents.

us_ascii()

Returns the US ASCII character set translation table.