use libmpegts::utils::textcode::{
Codepage,
TextcodeRef,
};
#[test]
fn test_decode_iso6937() {
let e = "Hello!".as_bytes();
let x = TextcodeRef::try_from(e).expect("expected string");
assert_eq!(x.codepage(), Codepage::Iso6937);
assert_eq!(x.to_string(), String::from_utf8_lossy(e));
}
#[test]
fn test_decode_iso8859() {
let e: &[u8] = &[0x10, 0x00, 0x05, 0xbf, 0xe0, 0xd8, 0xd2, 0xd5, 0xe2, 0x21];
let x = TextcodeRef::try_from(e).expect("expected string");
assert_eq!(x.codepage(), Codepage::Iso8859_5);
assert_eq!(&x.to_string(), "Привет!");
}