1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use super::CodePage;

/// Information about a code page.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CodePageInfo {
    /// The maximum length, in bytes, of a character in the code page.
    pub max_char_size: u8,
    /// The default character used when translating to the code page.
    pub default: String,
    /// An array of lead byte ranges.
    pub lead_byte: [u8; 12],
    /// The default unicode character used when translating to the code page.
    pub unicode_default: String,
    /// The code page associated with the information.
    pub code_page: CodePage,
    /// The full name of the code page.
    pub name: String,
}

impl Default for CodePageInfo {
    /**
    Returns an empty CodePageInfo object.
    */
    fn default() -> Self {
        Self {
            max_char_size: 0,
            default: String::new(),
            lead_byte: [0; 12],
            unicode_default: String::new(),
            code_page: CodePage::None,
            name: String::new(),
        }
    }
}