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
/* Copyright 2016 Torbjørn Birch Moltu
*
* Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
* http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
* http://opensource.org/licenses/MIT>, at your option. This file may not be
* copied, modified, or distributed except according to those terms.
*/
/*!
Alternatives and extensions to the unstable `char.encode_utf8()` and `char.encode_utf16()`.
[crates.io page](https://crates.io/crates/encode_unicode)
[github repository](https://github.com/tormol/encode_unicode)
# Optional features:
* **no_std**: Use `#[no_std]`; There are some differences:
* `AsciiExt` doesn't exist, but `is_ascii()` is made available as an inherent impl.
* `Error` doesn't exist, but `description()` is made available as an inherent impl.
* There is no `io`, so `Utf8Iterator` doesn't implement `Read`.
* The iterators doesn't implement `Debug`.
* **ascii**: Convert `Utf8Char` and `Utf16Char` to and from [ascii](https://tomprogrammer.github.io/rust-ascii/ascii/index.html)::[`AsciiChar`](https://tomprogrammer.github.io/rust-ascii/ascii/enum.AsciiChar.html).
* **ascii_no_std**: You need to use this feature instead of both ascii and no_std.
This is because the ascii crate needs to know about `#[no_std]`, but the features are otherwize independent.
*/
// either `cargo clippy` doesn't see theese, or I get a warning when I build.
// UtfxChar is never empty
// tested
// precedence: I prefer spaces to parentheses, but it's nice to recheck.
pub use CharExt;
pub use Utf8Char;
pub use Utf16Char;
pub use Utf8Iterator;
pub use Utf16Iterator;
pub use U8UtfExt;
pub use U16UtfExt;