Raxol.Terminal.ANSI.CharacterTranslations (Raxol v0.5.0)
View SourceProvides 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.
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
Returns the DEC Special Graphics character set translation table.
Returns
- Map containing DEC Special Graphics character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.dec_special()
%{...}
Returns the DEC Supplementary character set translation table.
Returns
- Map containing DEC Supplementary character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.dec_supplementary()
%{...}
Returns the DEC Supplementary Graphics character set translation table.
Returns
- Map containing DEC Supplementary Graphics character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.dec_supplementary_graphics()
%{...}
Returns the DEC Technical character set translation table.
Returns
- Map containing DEC Technical character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.dec_technical()
%{...}
Returns the French character set translation table.
Returns
- Map containing French character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.french()
%{...}
Returns the German character set translation table.
Returns
- Map containing German character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.german()
%{...}
Returns the Latin-1 character set translation table.
Returns
- Map containing Latin-1 character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.latin1()
%{...}
Translates a character from the source character set to the target character set.
Parameters
char_codepoint
- The Unicode codepoint of the character to translatecharset
- The target character set to translate to (e.g.,:us_ascii
,:uk
,:french
)
Returns
- Binary containing the translated character in UTF-8 encoding
- The original character if no translation exists
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.translate_char(?é, :us_ascii)
"e"
iex> Raxol.Terminal.ANSI.CharacterTranslations.translate_char(?a, :us_ascii)
"a"
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.
Returns
- Map containing UK character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.uk()
%{...}
Map of Unicode codepoints to their ANSI terminal equivalents.
Returns the US ASCII character set translation table.
Returns
- Map containing US ASCII character translations
Examples
iex> Raxol.Terminal.ANSI.CharacterTranslations.us_ascii()
%{...}