use super::{ Pullable, PullBuffer, PushBuffer, TranscoderKind, TranscoderImpl, Transcoder }; // String Transcoders pub struct EncodeString; impl TranscoderKind for EncodeString { type Input = char; type Output = u8; } pub type StringEncoder = Transcoder; pub struct DecodeString; impl TranscoderKind for DecodeString { type Input = u8; type Output = char; } pub type StringDecoder = Transcoder; // Encoding Implementations pub mod adobe { include!(concat!(env!("OUT_DIR"), "/adobe.rs")); } pub mod dos { include!(concat!(env!("OUT_DIR"), "/dos.rs")); } pub mod ebcdic { include!(concat!(env!("OUT_DIR"), "/ebcdic.rs")); } pub mod iso8859 { include!(concat!(env!("OUT_DIR"), "/iso8859.rs")); } pub mod macos { include!(concat!(env!("OUT_DIR"), "/macos.rs")); } pub mod misc { include!(concat!(env!("OUT_DIR"), "/misc.rs")); } pub mod next { include!(concat!(env!("OUT_DIR"), "/next.rs")); } pub mod windows { include!(concat!(env!("OUT_DIR"), "/windows.rs")); } pub mod unicode { use crate::{ Pullable, PullBuffer, PushBuffer, TranscoderImpl }; use super::{ EncodeString, DecodeString }; // UTF-16 Little Endian /// Implementation of UTF-16 little endian. #[derive(Clone, Copy)] pub struct Utf16LE; impl TranscoderImpl for Utf16LE where I: Pullable { fn transcode(&self, input: &mut PullBuffer, output: &mut PushBuffer<'_, u8>) { while output.fits(2) { match *input.view(1) { [x @ '\u{0000}'..='\u{FFFF}'] => { let x = x as u32; output.push([ (x & 0xFF) as u8, (x >> 8) as u8, ]); input.advance(1); }, [x] if output.fits(4) => { let x = x as u32 - 0x10000; output.push([ ((x >> 10) & 0xFF) as u8, ((x >> 18) & 3) as u8 | 0xD8, (x & 0xFF) as u8, ((x >> 8) & 3) as u8 | 0xDC, ]); input.advance(1); }, [..] => break, } } } } impl TranscoderImpl for Utf16LE where I: Pullable { fn transcode(&self, input: &mut PullBuffer, output: &mut PushBuffer<'_, char>) { while output.fits(1) { match *input.view(4) { [] | [_] => break, [lo, hi @ 0x00..=0xD7, ..] | [lo, hi @ 0xE0..=0xFF, ..] => { let lo = lo as u32; let hi = (hi as u32) << 8; output.push([ char::from_u32(lo | hi).unwrap() ]); input.advance(2); }, [lo1, hi1 @ 0xD8..=0xDB, lo2, hi2 @ 0xDC..=0xDF] => { let lo1 = (lo1 as u32) << 10; let hi1 = ((hi1 & 3) as u32) << 18; let lo2 = lo2 as u32; let hi2 = ((hi2 & 3) as u32) << 8; let x = lo1 | hi1 | lo2 | hi2; output.push([ char::from_u32(x + 0x10000).unwrap() ]); input.advance(4); }, [_, _, ..] => input.advance(2), } } } } // UTF-16 Big Endian /// Implementation of UTF-16 big endian. #[derive(Clone, Copy)] pub struct Utf16BE; impl TranscoderImpl for Utf16BE where I: Pullable { fn transcode(&self, input: &mut PullBuffer, output: &mut PushBuffer<'_, u8>) { while output.fits(2) { match *input.view(1) { [x @ '\u{0000}'..='\u{FFFF}'] => { let x = x as u32; output.push([ (x >> 8) as u8, (x & 0xFF) as u8, ]); input.advance(1); }, [x] if output.fits(4) => { let x = x as u32 - 0x10000; output.push([ ((x >> 18) & 3) as u8 | 0xD8, ((x >> 10) & 0xFF) as u8, ((x >> 8) & 3) as u8 | 0xDC, (x & 0xFF) as u8, ]); input.advance(1); }, [..] => break, } } } } impl TranscoderImpl for Utf16BE where I: Pullable { fn transcode(&self, input: &mut PullBuffer, output: &mut PushBuffer<'_, char>) { while output.fits(1) { match *input.view(4) { [] | [_] => break, [hi @ 0x00..=0xD7, lo, ..] | [hi @ 0xE0..=0xFF, lo, ..] => { let lo = lo as u32; let hi = (hi as u32) << 8; output.push([ char::from_u32(lo | hi).unwrap() ]); input.advance(2); }, [hi1 @ 0xD8..=0xDB, lo1, hi2 @ 0xDC..=0xDF, lo2] => { let lo1 = (lo1 as u32) << 10; let hi1 = ((hi1 & 3) as u32) << 18; let lo2 = lo2 as u32; let hi2 = ((hi2 & 3) as u32) << 8; let x = lo1 | hi1 | lo2 | hi2; output.push([ char::from_u32(x + 0x10000).unwrap() ]); input.advance(4); }, [_, _, ..] => input.advance(2), } } } } } // Static Dispatch /// Any implementation of `EncodeString` and `DecodeString` in this crate used for static dispatch (using match on enum). #[derive(Clone, Copy)] pub enum Std { // Adobe AdobeStandard, AdobeSymbol, AdobeZapfDingbats, // DOS DosCp437, DosCp737, DosCp775, DosCp850, DosCp852, DosCp855, DosCp857, DosCp860, DosCp861, DosCp862, DosCp863, DosCp864, DosCp865, DosCp866, DosCp869, DosCp874, // EBCDIC EbcdicCp037, EbcdicCp500, EbcdicCp875, EbcdicCp1026, // ETSI //EtsiGsm0338, // ISO 8859 Iso8859_1, Iso8859_2, Iso8859_3, Iso8859_4, Iso8859_5, Iso8859_6, Iso8859_7, Iso8859_8, Iso8859_9, Iso8859_10, Iso8859_11, Iso8859_13, Iso8859_14, Iso8859_15, Iso8859_16, // macOS MacArabic, MacCeltic, MacCentralEuropean, //MacChineseSimplified, //MacChineseTraditional, //MacCorporateZone, MacCroatian, MacCyrillic, //MacDevanaga, MacDingbats, MacFarsi, MacGaelic, MacGreek, //MacGujarati, //MacGurmukhi, //MacHebrew, MacIceland, MacInuit, //MacJapanese, //MacKeyboard, //MacKorean, MacRoman, MacRomanian, //MacSymbol, //MacThai, MacTurkish, // Misc //MiscAplIsoIr68, MiscAtariST, MiscCp424, MiscCp856, MiscCp1006, //MiscIbmGraphics, MiscKoi8R, MiscKoi8U, //MiscKps9566, MiscKz1048, //MiscSgml, MiscAsciiQuotes, // Next NextStep, // Windows WindowsCp874, //WindowsCp932, //WindowsCp936, //WindowsCp949, //WindowsCp950, WindowsCp1250, WindowsCp1251, WindowsCp1252, WindowsCp1253, WindowsCp1254, WindowsCp1255, WindowsCp1256, WindowsCp1267, WindowsCp1268, // Unicode Utf16LE, Utf16BE, } /* impl Std { pub fn any(&self) -> &'static Any { match self { // Adobe Self::AdobeStandard => &adobe::Standard, Self::AdobeSymbol => &adobe::Symbol, Self::AdobeZapfDingbats => &adobe::ZapfDingbats, // DOS Self::DosCp437 => &dos::Cp437, Self::DosCp737 => &dos::Cp737, Self::DosCp775 => &dos::Cp775, Self::DosCp850 => &dos::Cp850, Self::DosCp852 => &dos::Cp852, Self::DosCp855 => &dos::Cp855, Self::DosCp857 => &dos::Cp857, Self::DosCp860 => &dos::Cp860, Self::DosCp861 => &dos::Cp861, Self::DosCp862 => &dos::Cp862, Self::DosCp863 => &dos::Cp863, Self::DosCp864 => &dos::Cp864, Self::DosCp865 => &dos::Cp865, Self::DosCp866 => &dos::Cp866, Self::DosCp869 => &dos::Cp869, Self::DosCp874 => &dos::Cp874, // EBCDIC Self::EbcdicCp037 => &ebcdic::Cp037, Self::EbcdicCp500 => &ebcdic::Cp500, Self::EbcdicCp875 => &ebcdic::Cp875, Self::EbcdicCp1026 => &ebcdic::Cp1026, // ETSI //Self::EtsiGsm0338 => &etsi::Gsm0338, // ISO 8859 Self::Iso8859_1 => &iso8859::Iso8859_1, Self::Iso8859_2 => &iso8859::Iso8859_2, Self::Iso8859_3 => &iso8859::Iso8859_3, Self::Iso8859_4 => &iso8859::Iso8859_4, Self::Iso8859_5 => &iso8859::Iso8859_5, Self::Iso8859_6 => &iso8859::Iso8859_6, Self::Iso8859_7 => &iso8859::Iso8859_7, Self::Iso8859_8 => &iso8859::Iso8859_8, Self::Iso8859_9 => &iso8859::Iso8859_9, Self::Iso8859_10 => &iso8859::Iso8859_10, Self::Iso8859_11 => &iso8859::Iso8859_11, Self::Iso8859_13 => &iso8859::Iso8859_13, Self::Iso8859_14 => &iso8859::Iso8859_14, Self::Iso8859_15 => &iso8859::Iso8859_15, Self::Iso8859_16 => &iso8859::Iso8859_16, // macOS Self::MacArabic => &macos::Arabic, Self::MacCeltic => &macos::Celtic, Self::MacCentralEuropean => &macos::CentralEuropean, //Self::MacChineseSimplified => &macos::ChineseSimplified, //Self::MacChineseTraditional => &macos::ChineseTraditional, //Self::MacCorporateZone => &macos::CorporateZone, Self::MacCroatian => &macos::Croatian, Self::MacCyrillic => &macos::Cyrillic, //Self::MacDevanaga => &macos::Devanaga, Self::MacDingbats => &macos::Dingbats, Self::MacFarsi => &macos::Farsi, Self::MacGaelic => &macos::Gaelic, Self::MacGreek => &macos::Greek, //Self::MacGujarati => &macos::Gujarati, //Self::MacGurmukhi => &macos::Gurmukhi, //Self::MacHebrew => &macos::Hebrew, Self::MacIceland => &macos::Iceland, Self::MacInuit => &macos::Inuit, //Self::MacJapanese => &macos::Japanese, //Self::MacKeyboard => &macos::Keyboard, //Self::MacKorean => &macos::Korean, Self::MacRoman => &macos::Roman, Self::MacRomanian => &macos::Romanian, //Self::MacSymbol => &macos::Symbol, //Self::MacThai => &macos::Thai, Self::MacTurkish => &macos::Turkish, // Misc //Self::MiscAplIsoIr68 => &misc::AplIsoIr68, Self::MiscAtariST => &misc::AtariST, Self::MiscCp424 => &misc::Cp424, Self::MiscCp856 => &misc::Cp856, Self::MiscCp1006 => &misc::Cp1006, //Self::MiscIbmGraphics => &misc::IbmGraphics, Self::MiscKoi8R => &misc::Koi8R, Self::MiscKoi8U => &misc::Koi8U, //Self::MiscKps9566 => &misc::Kps9566, Self::MiscKz1048 => &misc::Kz1048, //Self::MiscSgml => &misc::Sgml, Self::MiscAsciiQuotes => &misc::AsciiQuotes, // Next Self::NextStep => &next::NextStep, // Windows Self::WindowsCp874 => &windows::Cp874, //Self::WindowsCp932 => &windows::Cp932, //Self::WindowsCp936 => &windows::Cp936, //Self::WindowsCp949 => &windows::Cp949, //Self::WindowsCp950 => &windows::Cp950, Self::WindowsCp1250 => &windows::Cp1250, Self::WindowsCp1251 => &windows::Cp1251, Self::WindowsCp1252 => &windows::Cp1252, Self::WindowsCp1253 => &windows::Cp1253, Self::WindowsCp1254 => &windows::Cp1254, Self::WindowsCp1255 => &windows::Cp1255, Self::WindowsCp1256 => &windows::Cp1256, Self::WindowsCp1267 => &windows::Cp1267, Self::WindowsCp1268 => &windows::Cp1268, // Unicode Self::Utf16LE => &unicode::Utf16LE, Self::Utf16BE => &unicode::Utf16BE, } } } */ impl TranscoderImpl for Std where I: Pullable { fn transcode(&self, input: &mut PullBuffer, output: &mut PushBuffer<'_, u8>) { match self { // Adobe Self::AdobeStandard => adobe::Standard.transcode(input, output), Self::AdobeSymbol => adobe::Symbol.transcode(input, output), Self::AdobeZapfDingbats => adobe::ZapfDingbats.transcode(input, output), // DOS Self::DosCp437 => dos::Cp437.transcode(input, output), Self::DosCp737 => dos::Cp737.transcode(input, output), Self::DosCp775 => dos::Cp775.transcode(input, output), Self::DosCp850 => dos::Cp850.transcode(input, output), Self::DosCp852 => dos::Cp852.transcode(input, output), Self::DosCp855 => dos::Cp855.transcode(input, output), Self::DosCp857 => dos::Cp857.transcode(input, output), Self::DosCp860 => dos::Cp860.transcode(input, output), Self::DosCp861 => dos::Cp861.transcode(input, output), Self::DosCp862 => dos::Cp862.transcode(input, output), Self::DosCp863 => dos::Cp863.transcode(input, output), Self::DosCp864 => dos::Cp864.transcode(input, output), Self::DosCp865 => dos::Cp865.transcode(input, output), Self::DosCp866 => dos::Cp866.transcode(input, output), Self::DosCp869 => dos::Cp869.transcode(input, output), Self::DosCp874 => dos::Cp874.transcode(input, output), // EBCDIC Self::EbcdicCp037 => ebcdic::Cp037.transcode(input, output), Self::EbcdicCp500 => ebcdic::Cp500.transcode(input, output), Self::EbcdicCp875 => ebcdic::Cp875.transcode(input, output), Self::EbcdicCp1026 => ebcdic::Cp1026.transcode(input, output), // ETSI //Self::EtsiGsm0338 => etsi::Gsm0338.transcode(input, output), // ISO 8859 Self::Iso8859_1 => iso8859::Iso8859_1.transcode(input, output), Self::Iso8859_2 => iso8859::Iso8859_2.transcode(input, output), Self::Iso8859_3 => iso8859::Iso8859_3.transcode(input, output), Self::Iso8859_4 => iso8859::Iso8859_4.transcode(input, output), Self::Iso8859_5 => iso8859::Iso8859_5.transcode(input, output), Self::Iso8859_6 => iso8859::Iso8859_6.transcode(input, output), Self::Iso8859_7 => iso8859::Iso8859_7.transcode(input, output), Self::Iso8859_8 => iso8859::Iso8859_8.transcode(input, output), Self::Iso8859_9 => iso8859::Iso8859_9.transcode(input, output), Self::Iso8859_10 => iso8859::Iso8859_10.transcode(input, output), Self::Iso8859_11 => iso8859::Iso8859_11.transcode(input, output), Self::Iso8859_13 => iso8859::Iso8859_13.transcode(input, output), Self::Iso8859_14 => iso8859::Iso8859_14.transcode(input, output), Self::Iso8859_15 => iso8859::Iso8859_15.transcode(input, output), Self::Iso8859_16 => iso8859::Iso8859_16.transcode(input, output), // macOS Self::MacArabic => macos::Arabic.transcode(input, output), Self::MacCeltic => macos::Celtic.transcode(input, output), Self::MacCentralEuropean => macos::CentralEuropean.transcode(input, output), //Self::MacChineseSimplified => macos::ChineseSimplified.transcode(input, output), //Self::MacChineseTraditional => macos::ChineseTraditional.transcode(input, output), //Self::MacCorporateZone => macos::CorporateZone.transcode(input, output), Self::MacCroatian => macos::Croatian.transcode(input, output), Self::MacCyrillic => macos::Cyrillic.transcode(input, output), //Self::MacDevanaga => macos::Devanaga.transcode(input, output), Self::MacDingbats => macos::Dingbats.transcode(input, output), Self::MacFarsi => macos::Farsi.transcode(input, output), Self::MacGaelic => macos::Gaelic.transcode(input, output), Self::MacGreek => macos::Greek.transcode(input, output), //Self::MacGujarati => macos::Gujarati.transcode(input, output), //Self::MacGurmukhi => macos::Gurmukhi.transcode(input, output), //Self::MacHebrew => macos::Hebrew.transcode(input, output), Self::MacIceland => macos::Iceland.transcode(input, output), Self::MacInuit => macos::Inuit.transcode(input, output), //Self::MacJapanese => macos::Japanese.transcode(input, output), //Self::MacKeyboard => macos::Keyboard.transcode(input, output), //Self::MacKorean => macos::Korean.transcode(input, output), Self::MacRoman => macos::Roman.transcode(input, output), Self::MacRomanian => macos::Romanian.transcode(input, output), //Self::MacSymbol => macos::Symbol.transcode(input, output), //Self::MacThai => macos::Thai.transcode(input, output), Self::MacTurkish => macos::Turkish.transcode(input, output), // Misc //Self::MiscAplIsoIr68 => misc::AplIsoIr68.transcode(input, output), Self::MiscAtariST => misc::AtariST.transcode(input, output), Self::MiscCp424 => misc::Cp424.transcode(input, output), Self::MiscCp856 => misc::Cp856.transcode(input, output), Self::MiscCp1006 => misc::Cp1006.transcode(input, output), //Self::MiscIbmGraphics => misc::IbmGraphics.transcode(input, output), Self::MiscKoi8R => misc::Koi8R.transcode(input, output), Self::MiscKoi8U => misc::Koi8U.transcode(input, output), //Self::MiscKps9566 => misc::Kps9566.transcode(input, output), Self::MiscKz1048 => misc::Kz1048.transcode(input, output), //Self::MiscSgml => misc::Sgml.transcode(input, output), Self::MiscAsciiQuotes => misc::AsciiQuotes.transcode(input, output), // Next Self::NextStep => next::NextStep.transcode(input, output), // Windows Self::WindowsCp874 => windows::Cp874.transcode(input, output), //Self::WindowsCp932 => windows::Cp932.transcode(input, output), //Self::WindowsCp936 => windows::Cp936.transcode(input, output), //Self::WindowsCp949 => windows::Cp949.transcode(input, output), //Self::WindowsCp950 => windows::Cp950.transcode(input, output), Self::WindowsCp1250 => windows::Cp1250.transcode(input, output), Self::WindowsCp1251 => windows::Cp1251.transcode(input, output), Self::WindowsCp1252 => windows::Cp1252.transcode(input, output), Self::WindowsCp1253 => windows::Cp1253.transcode(input, output), Self::WindowsCp1254 => windows::Cp1254.transcode(input, output), Self::WindowsCp1255 => windows::Cp1255.transcode(input, output), Self::WindowsCp1256 => windows::Cp1256.transcode(input, output), Self::WindowsCp1267 => windows::Cp1267.transcode(input, output), Self::WindowsCp1268 => windows::Cp1268.transcode(input, output), // Unicode Self::Utf16LE => unicode::Utf16LE.transcode(input, output), Self::Utf16BE => unicode::Utf16BE.transcode(input, output), } } } impl TranscoderImpl for Std where I: Pullable { fn transcode(&self, input: &mut PullBuffer, output: &mut PushBuffer<'_, char>) { match self { // Adobe Self::AdobeStandard => adobe::Standard.transcode(input, output), Self::AdobeSymbol => adobe::Symbol.transcode(input, output), Self::AdobeZapfDingbats => adobe::ZapfDingbats.transcode(input, output), // DOS Self::DosCp437 => dos::Cp437.transcode(input, output), Self::DosCp737 => dos::Cp737.transcode(input, output), Self::DosCp775 => dos::Cp775.transcode(input, output), Self::DosCp850 => dos::Cp850.transcode(input, output), Self::DosCp852 => dos::Cp852.transcode(input, output), Self::DosCp855 => dos::Cp855.transcode(input, output), Self::DosCp857 => dos::Cp857.transcode(input, output), Self::DosCp860 => dos::Cp860.transcode(input, output), Self::DosCp861 => dos::Cp861.transcode(input, output), Self::DosCp862 => dos::Cp862.transcode(input, output), Self::DosCp863 => dos::Cp863.transcode(input, output), Self::DosCp864 => dos::Cp864.transcode(input, output), Self::DosCp865 => dos::Cp865.transcode(input, output), Self::DosCp866 => dos::Cp866.transcode(input, output), Self::DosCp869 => dos::Cp869.transcode(input, output), Self::DosCp874 => dos::Cp874.transcode(input, output), // EBCDIC Self::EbcdicCp037 => ebcdic::Cp037.transcode(input, output), Self::EbcdicCp500 => ebcdic::Cp500.transcode(input, output), Self::EbcdicCp875 => ebcdic::Cp875.transcode(input, output), Self::EbcdicCp1026 => ebcdic::Cp1026.transcode(input, output), // ETSI //Self::EtsiGsm0338 => etsi::Gsm0338.transcode(input, output), // ISO 8859 Self::Iso8859_1 => iso8859::Iso8859_1.transcode(input, output), Self::Iso8859_2 => iso8859::Iso8859_2.transcode(input, output), Self::Iso8859_3 => iso8859::Iso8859_3.transcode(input, output), Self::Iso8859_4 => iso8859::Iso8859_4.transcode(input, output), Self::Iso8859_5 => iso8859::Iso8859_5.transcode(input, output), Self::Iso8859_6 => iso8859::Iso8859_6.transcode(input, output), Self::Iso8859_7 => iso8859::Iso8859_7.transcode(input, output), Self::Iso8859_8 => iso8859::Iso8859_8.transcode(input, output), Self::Iso8859_9 => iso8859::Iso8859_9.transcode(input, output), Self::Iso8859_10 => iso8859::Iso8859_10.transcode(input, output), Self::Iso8859_11 => iso8859::Iso8859_11.transcode(input, output), Self::Iso8859_13 => iso8859::Iso8859_13.transcode(input, output), Self::Iso8859_14 => iso8859::Iso8859_14.transcode(input, output), Self::Iso8859_15 => iso8859::Iso8859_15.transcode(input, output), Self::Iso8859_16 => iso8859::Iso8859_16.transcode(input, output), // macOS Self::MacArabic => macos::Arabic.transcode(input, output), Self::MacCeltic => macos::Celtic.transcode(input, output), Self::MacCentralEuropean => macos::CentralEuropean.transcode(input, output), //Self::MacChineseSimplified => macos::ChineseSimplified.transcode(input, output), //Self::MacChineseTraditional => macos::ChineseTraditional.transcode(input, output), //Self::MacCorporateZone => macos::CorporateZone.transcode(input, output), Self::MacCroatian => macos::Croatian.transcode(input, output), Self::MacCyrillic => macos::Cyrillic.transcode(input, output), //Self::MacDevanaga => macos::Devanaga.transcode(input, output), Self::MacDingbats => macos::Dingbats.transcode(input, output), Self::MacFarsi => macos::Farsi.transcode(input, output), Self::MacGaelic => macos::Gaelic.transcode(input, output), Self::MacGreek => macos::Greek.transcode(input, output), //Self::MacGujarati => macos::Gujarati.transcode(input, output), //Self::MacGurmukhi => macos::Gurmukhi.transcode(input, output), //Self::MacHebrew => macos::Hebrew.transcode(input, output), Self::MacIceland => macos::Iceland.transcode(input, output), Self::MacInuit => macos::Inuit.transcode(input, output), //Self::MacJapanese => macos::Japanese.transcode(input, output), //Self::MacKeyboard => macos::Keyboard.transcode(input, output), //Self::MacKorean => macos::Korean.transcode(input, output), Self::MacRoman => macos::Roman.transcode(input, output), Self::MacRomanian => macos::Romanian.transcode(input, output), //Self::MacSymbol => macos::Symbol.transcode(input, output), //Self::MacThai => macos::Thai.transcode(input, output), Self::MacTurkish => macos::Turkish.transcode(input, output), // Misc //Self::MiscAplIsoIr68 => misc::AplIsoIr68.transcode(input, output), Self::MiscAtariST => misc::AtariST.transcode(input, output), Self::MiscCp424 => misc::Cp424.transcode(input, output), Self::MiscCp856 => misc::Cp856.transcode(input, output), Self::MiscCp1006 => misc::Cp1006.transcode(input, output), //Self::MiscIbmGraphics => misc::IbmGraphics.transcode(input, output), Self::MiscKoi8R => misc::Koi8R.transcode(input, output), Self::MiscKoi8U => misc::Koi8U.transcode(input, output), //Self::MiscKps9566 => misc::Kps9566.transcode(input, output), Self::MiscKz1048 => misc::Kz1048.transcode(input, output), //Self::MiscSgml => misc::Sgml.transcode(input, output), Self::MiscAsciiQuotes => misc::AsciiQuotes.transcode(input, output), // Next Self::NextStep => next::NextStep.transcode(input, output), // Windows Self::WindowsCp874 => windows::Cp874.transcode(input, output), //Self::WindowsCp932 => windows::Cp932.transcode(input, output), //Self::WindowsCp936 => windows::Cp936.transcode(input, output), //Self::WindowsCp949 => windows::Cp949.transcode(input, output), //Self::WindowsCp950 => windows::Cp950.transcode(input, output), Self::WindowsCp1250 => windows::Cp1250.transcode(input, output), Self::WindowsCp1251 => windows::Cp1251.transcode(input, output), Self::WindowsCp1252 => windows::Cp1252.transcode(input, output), Self::WindowsCp1253 => windows::Cp1253.transcode(input, output), Self::WindowsCp1254 => windows::Cp1254.transcode(input, output), Self::WindowsCp1255 => windows::Cp1255.transcode(input, output), Self::WindowsCp1256 => windows::Cp1256.transcode(input, output), Self::WindowsCp1267 => windows::Cp1267.transcode(input, output), Self::WindowsCp1268 => windows::Cp1268.transcode(input, output), // Unicode Self::Utf16LE => unicode::Utf16LE.transcode(input, output), Self::Utf16BE => unicode::Utf16BE.transcode(input, output), } } } /// Encoder using static dispatch. pub type StdEncoder = StringEncoder; /// Decoder using static dispatch. pub type StdDecoder = StringDecoder;