4 releases

0.1.3 Dec 18, 2022
0.1.2 Dec 18, 2022
0.1.1 Oct 29, 2022
0.1.0 Oct 29, 2022

#1443 in Text processing


Used in 2 crates

MIT/Apache

10KB
163 lines

latin1str

This crate is a thin wrapper around encoding_rs that provides Latin1Str and Latin1String similar to str and String for use with Windows-1252 encoded text.

License

MIT OR Apache-2.0


lib.rs:

latin1str

This crate is a thin wrapper around encoding_rs that provides types to work with WINDOWS-1252 (aka Latin-1) encoded strings.

The main points about these types is that they:

  • Are not nul-terminated
  • Contain no nul-bytes
  • Are infallibly convertible to UTF-8
  • Are infallibly convertible from ASCII
  • Are infallibly convertible from a [[u8]][slice]

You can use this if none of the following alternatives fit:

  • CStr, which requires trailing nul-bytes
  • [str], which is UTF-8 encoded
  • [[u8]][slice], which lacks a defined encoding

There are two types provided:

Dependencies

~3.5MB
~125K SLoC