#utf-16 #unicode #iterator

utf16_iter

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

6 stable releases

new 1.0.5 Dec 1, 2023
1.0.4 Sep 9, 2022
1.0.3 Jul 19, 2022
1.0.2 Jul 14, 2022
1.0.0 Jun 13, 2022

#663 in Text processing

Download history 11197/week @ 2023-08-15 11112/week @ 2023-08-22 10234/week @ 2023-08-29 9880/week @ 2023-09-05 8230/week @ 2023-09-12 12670/week @ 2023-09-19 7697/week @ 2023-09-26 7754/week @ 2023-10-03 7967/week @ 2023-10-10 10806/week @ 2023-10-17 8579/week @ 2023-10-24 8107/week @ 2023-10-31 8951/week @ 2023-11-07 11904/week @ 2023-11-14 9798/week @ 2023-11-21 10884/week @ 2023-11-28

42,898 downloads per month
Used in 35 crates (2 directly)

Apache-2.0 OR MIT

23KB
415 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.

Iteration by Result<char,Utf16CharsError> is provided as an alternative that distinguishes unpaired surrogates from U+FFFD appearing in the input.

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.5

  • Add iteration by Result<char,Utf16CharsError>.

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.

No runtime deps