#encoding #utf-16 #unicode #iterator

utf16_iter

Iterator by char over potentially-invalid UTF-16 in &[u16]

5 stable releases

Uses new Rust 2021

1.0.4 Sep 9, 2022
1.0.3 Jul 19, 2022
1.0.2 Jul 14, 2022
1.0.0 Jun 13, 2022

#215 in Text processing

Download history 2071/week @ 2022-08-07 3988/week @ 2022-08-14 3228/week @ 2022-08-21 5165/week @ 2022-08-28 4024/week @ 2022-09-04 2662/week @ 2022-09-11 4660/week @ 2022-09-18 5768/week @ 2022-09-25 2395/week @ 2022-10-02 3040/week @ 2022-10-09 1807/week @ 2022-10-16 1687/week @ 2022-10-23 1490/week @ 2022-10-30 1521/week @ 2022-11-06 1201/week @ 2022-11-13 1676/week @ 2022-11-20

5,902 downloads per month
Used in 9 crates (2 directly)

Apache-2.0 OR MIT

13KB
239 lines

utf16_iter

crates.io docs.rs

utf16_iter provides iteration by char over potentially-invalid UTF-16 &[u16] such that UTF-16 errors are replaced with the REPLACEMENT CHARACTER.

This is a no_std crate.

Licensing

TL;DR: Apache-2.0 OR MIT

Please see the file named COPYRIGHT.

Documentation

Generated API documentation is available online.

Release Notes

1.0.4

  • char_indices() implementation.

1.0.3

  • Tweak inlining.

1.0.2

  • Implemented DoubleEndedIterator.

1.0.1

  • Added as_slice() method.

1.0.0

The initial release.


lib.rs:

Provides iteration by char over &[u16] containing potentially-invalid UTF-16 such that errors are replaced with the REPLACEMENT CHARACTER.

The trait Utf16CharsEx provides the convenience method chars() on byte slices themselves instead of having to use the more verbose Utf16Chars::new(slice).

No runtime deps