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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! # textcode
//!
//! [](https://docs.rs/textcode)
//!
//! ## Intro
//!
//! textcode is a library for text encoding/decoding. Supports next charsets:
//!
//! - `UTF-8`
//! - `UTF-16BE` - UTF-16 Big Endian
//! - `UTF-16LE` - UTF-16 Little Endian
//! - `iso-6937` - Latin superset of ISO/IEC 6937 with addition of the Euro symbol
//! - `iso-8859-1` - Western European
//! - `iso-8859-2` - Central European
//! - `iso-8859-3` - South European
//! - `iso-8859-4` - North European
//! - `iso-8859-5` - Cyrillic
//! - `iso-8859-6` - Arabic
//! - `iso-8859-7` - Greek
//! - `iso-8859-8` - Hebrew
//! - `iso-8859-9` - Turkish
//! - `iso-8859-10` - Nordic
//! - `iso-8859-11` - Thai
//! - `iso-8859-13` - Baltic Rim
//! - `iso-8859-14` - Celtic
//! - `iso-8859-15` - Western European
//! - `iso-8859-16` - South-Eastern European
//! - `gb2312` - Simplified Chinese
//! - `geo` - proprietary DVB single-byte Georgian encoding
//!
//! [Read more...](https://github.com/cesbo/textcode)
//!
//! ## Usage
//!
//! ```rust
//! use textcode::{Iso8859_5, decode, encode};
//!
//! let text = decode::<Iso8859_5>(b"\xbf\xe0\xd8\xd2\xd5\xe2!");
//! assert_eq!(text, "Привет!");
//!
//! let bytes = encode::<Iso8859_5>("Привет!");
//! assert_eq!(bytes, b"\xbf\xe0\xd8\xd2\xd5\xe2!");
//! ```
use Write;
pub use Gb2312;
pub use Geo;
pub use Iso6937;
pub use *;
pub use Utf8;
pub use Utf16;
pub use *;
/// Trait for text encoding/decoding implementations.
///
/// Types implementing this trait provide conversion between
/// a specific character encoding and UTF-8.
/// Decodes bytes from the source encoding to a UTF-8 String.
/// Decodes bytes from the source encoding to a UTF-8 slice.
/// Returns the number of bytes written.
/// Encodes UTF-8 string to the target encoding.
/// Encodes UTF-8 string to the target encoding slice.
/// Returns the number of bytes written.