CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
Cp437.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <cstdint>
13#include <string>
14
16
18uint32_t toUnicode(uint8_t b);
19
21uint8_t fromUnicode(uint32_t cp);
22
24std::string fromUtf8(const char* s);
25
27std::string toUtf8(const char* s);
28
29} // namespace cdc::core::cp437
std::string fromUtf8(const char *s)
Convert a UTF-8 string to CP437 bytes (unmapped chars dropped).
Definition Cp437.cpp:58
std::string toUtf8(const char *s)
Convert CP437 bytes to a UTF-8 string.
Definition Cp437.cpp:86
uint8_t fromUnicode(uint32_t cp)
Map a Unicode codepoint to its CP437 byte, or 0 if it has none.
Definition Cp437.cpp:40
uint32_t toUnicode(uint8_t b)
Map a CP437 byte to its Unicode codepoint. 0x00-0x7F is ASCII.
Definition Cp437.cpp:35