canboat 9.1.0

NMEA 2000 decoding, encoding and live-bus access: the CANboat PGN database as a library, plus the canboat CLI (convert / interface / server / tui).
Documentation
// Generated by keel from keel/src/charset.rs. DO NOT EDIT.
//
// Basic RDS (G0) character set: IEC 62106 table E.1, published as the
// "Complete EBU Latin based repertoire" in ETSI TS 101 756 V1.6.1 annex C.
// NOT the V1.8.1 (2015) repertoire, which is a DAB-only extension that
// reassigns 36 of these positions. See keel/src/charset.rs.
//
// 0 marks a code the standard leaves undefined; the decoder passes that
// byte through unchanged so the padding trims still recognise it.

/// Basic RDS (G0) for 0x20..=0xFF; `\0` is an undefined code.
#[rustfmt::skip]
pub static RDS_G0: [char; 224] = [
    // 0x20
    ' ', '!', '"', '#', '¤', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
    // 0x30
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
    // 0x40
    '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
    // 0x50
    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '―', '_',
    // 0x60
    '║', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
    // 0x70
    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '¯', '\0',
    // 0x80
    'á', 'à', 'é', 'è', 'í', 'ì', 'ó', 'ò', 'ú', 'ù', 'Ñ', 'Ç', 'Ş', 'ß', '¡', 'IJ',
    // 0x90
    'â', 'ä', 'ê', 'ë', 'î', 'ï', 'ô', 'ö', 'û', 'ü', 'ñ', 'ç', 'ş', 'ğ', 'ı', 'ij',
    // 0xA0
    'ª', 'α', '©', '‰', 'Ğ', 'ě', 'ň', 'ő', 'π', '€', '£', '$', '←', '↑', '→', '↓',
    // 0xB0
    'º', '¹', '²', '³', '±', 'İ', 'ń', 'ű', 'µ', '¿', '÷', '°', '¼', '½', '¾', '§',
    // 0xC0
    'Á', 'À', 'É', 'È', 'Í', 'Ì', 'Ó', 'Ò', 'Ú', 'Ù', 'Ř', 'Č', 'Š', 'Ž', 'Ð', 'Ŀ',
    // 0xD0
    'Â', 'Ä', 'Ê', 'Ë', 'Î', 'Ï', 'Ô', 'Ö', 'Û', 'Ü', 'ř', 'č', 'š', 'ž', 'đ', 'ŀ',
    // 0xE0
    'Ã', 'Å', 'Æ', 'Œ', 'ŷ', 'Ý', 'Õ', 'Ø', 'Þ', 'Ŋ', 'Ŕ', 'Ć', 'Ś', 'Ź', 'Ŧ', 'ð',
    // 0xF0
    'ã', 'å', 'æ', 'œ', 'ŵ', 'ý', 'õ', 'ø', 'þ', 'ŋ', 'ŕ', 'ć', 'ś', 'ź', 'ŧ', '\0',
];

/// One byte of Basic RDS. Undefined codes keep their own value so the
/// padding trims downstream still recognise them.
pub fn rds_g0_char(b: u8) -> char {
    if b < 0x20 {
        return b as char;
    }
    match RDS_G0[b as usize - 0x20] {
        '\0' => b as char,
        c => c,
    }
}