summaryrefslogtreecommitdiffstats
path: root/third_party/rust/utf8_iter/README.md
blob: c6290861ae81ec39764b77e602c146befd6487e4 (plain)
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
# utf8_iter

[![crates.io](https://img.shields.io/crates/v/utf8_iter.svg)](https://crates.io/crates/utf8_iter)
[![docs.rs](https://docs.rs/utf8_iter/badge.svg)](https://docs.rs/utf8_iter/)

utf8_iter provides iteration by `char` over potentially-invalid UTF-8 `&[u8]`
such that UTF-8 errors are handled according to the WHATWG Encoding Standard.

Key parts of the code are copypaste from the UTF-8 to UTF-16 conversion code
in `encoding_rs`, which was optimized for speed in the case of valid input.
The implementation here uses the structure that was found to be fast in the
`encoding_rs` context but the structure hasn't been benchmarked in this
context.

This is a `no_std` crate.

## Licensing

TL;DR: `Apache-2.0 OR MIT`

Please see the file named
[COPYRIGHT](https://github.com/hsivonen/utf8_iter/blob/master/COPYRIGHT).

## Documentation

Generated [API documentation](https://docs.rs/utf8_iter/) is available
online.

## Release Notes

### 1.0.3

* Fix an error in documentation.

### 1.0.2

* `char_indices()` implementation.

### 1.0.1

* `as_slice()` method.
* Implement `DoubleEndedIterator`

### 1.0.0

The initial release.