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
use std::io::{Error, ErrorKind, Result};
pub fn oem_to_string(data: &[u8]) -> Result<String> {
String::from_utf8(data.to_vec()).map_err(|e| Error::new(ErrorKind::InvalidInput, e))
}
pub fn ansi_to_string(data: &[u8]) -> Result<String> {
String::from_utf8(data.to_vec()).map_err(|e| Error::new(ErrorKind::InvalidInput, e))
}
pub fn string_to_oem(data: &str) -> Result<Vec<u8>> {
Ok(data.as_bytes().to_vec())
}
pub fn string_to_ansi(data: &str) -> Result<Vec<u8>> {
Ok(data.as_bytes().to_vec())
}