#utf-16 #iterator #unicode

utf16_iter

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

6 stable releases

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

#239 in Text processing

Download history 1506917/week @ 2025-01-28 1666195/week @ 2025-02-04 1659145/week @ 2025-02-11 2002238/week @ 2025-02-18 2331438/week @ 2025-02-25 2520455/week @ 2025-03-04 2555240/week @ 2025-03-11 3053296/week @ 2025-03-18 2752225/week @ 2025-03-25 2507475/week @ 2025-04-01 2649175/week @ 2025-04-08 2279395/week @ 2025-04-15 2390234/week @ 2025-04-22 2288822/week @ 2025-04-29 2138293/week @ 2025-05-06 1781466/week @ 2025-05-13

8,948,768 downloads per month
Used in 118 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