CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::core::cp437 Namespace Reference

Functions

uint32_t toUnicode (uint8_t b)
 Map a CP437 byte to its Unicode codepoint. 0x00-0x7F is ASCII.
uint8_t fromUnicode (uint32_t cp)
 Map a Unicode codepoint to its CP437 byte, or 0 if it has none.
std::string fromUtf8 (const char *s)
 Convert a UTF-8 string to CP437 bytes (unmapped chars dropped).
std::string toUtf8 (const char *s)
 Convert CP437 bytes to a UTF-8 string.

Function Documentation

◆ fromUnicode()

uint8_t cdc::core::cp437::fromUnicode ( uint32_t cp)

Map a Unicode codepoint to its CP437 byte, or 0 if it has none.

Definition at line 40 of file Cp437.cpp.

Referenced by fromUtf8().

◆ fromUtf8()

std::string cdc::core::cp437::fromUtf8 ( const char * s)

Convert a UTF-8 string to CP437 bytes (unmapped chars dropped).

Definition at line 58 of file Cp437.cpp.

References fromUnicode().

Referenced by cdc::ui::render::utf8ToCp437Inplace().

◆ toUnicode()

uint32_t cdc::core::cp437::toUnicode ( uint8_t b)

Map a CP437 byte to its Unicode codepoint. 0x00-0x7F is ASCII.

Definition at line 35 of file Cp437.cpp.

Referenced by toUtf8().

◆ toUtf8()

std::string cdc::core::cp437::toUtf8 ( const char * s)

Convert CP437 bytes to a UTF-8 string.

Definition at line 86 of file Cp437.cpp.

References toUnicode().

Referenced by cdc::plugin_manager::copyUtf8().