[−][src]Crate textcode
textcode
Intro
textcode is a library for text encoding/decoding. Supports next charsets:
UTF-8iso-6937- Latin superset of ISO/IEC 6937 with addition of the Euro symboliso-8859-1- Western Europeaniso-8859-2- Central Europeaniso-8859-3- South Europeaniso-8859-4- North Europeaniso-8859-5- Cyrilliciso-8859-6- Arabiciso-8859-7- Greekiso-8859-8- Hebrewiso-8859-9- Turkishiso-8859-10- Nordiciso-8859-11- Thaiiso-8859-13- Baltic Rimiso-8859-14- Celticiso-8859-15- Western Europeaniso-8859-16- South-Eastern Europeangb2312- Simplified Chinese
Example
use textcode::iso8859_5;
const UTF8: &str = "Привет!";
const ISO8859_5: &[u8] = &[0xbf, 0xe0, 0xd8, 0xd2, 0xd5, 0xe2, 0x21];
let mut dst: Vec<u8> = Vec::new();
iso8859_5::encode(UTF8, &mut dst);
assert_eq!(dst.as_slice(), ISO8859_5);
let mut dst = String::new();
iso8859_5::decode(ISO8859_5, &mut dst);
assert_eq!(UTF8, dst.as_str());
Modules
| gb2312 | Simplified Chinese |
| iso6937 | Latin superset of ISO/IEC 6937 with addition of the Euro symbol |
| iso8859_1 | Western European |
| iso8859_2 | Central European |
| iso8859_3 | South European |
| iso8859_4 | North European |
| iso8859_5 | Cyrillic |
| iso8859_6 | Arabic |
| iso8859_7 | Greek |
| iso8859_8 | Hebrew |
| iso8859_9 | Turkish |
| iso8859_10 | Nordic |
| iso8859_11 | Thai |
| iso8859_13 | Baltic Rim |
| iso8859_14 | Celtic |
| iso8859_15 | Western European |
| iso8859_16 | South-Eastern European |