#utf-16 #utf-32 #wide #winapi #string #string-literal #compile-time

no-std widestring

A wide string Rust library for converting to and from wide strings, such as those often used in Windows API or other FFI libaries. Both u16 and u32 string types are provided, including support for UTF-16 and UTF-32, malformed encoding, C-style strings, etc.

15 releases (4 stable)

1.1.0 Apr 6, 2024
1.0.2 Jul 15, 2022
1.0.1 Jun 24, 2022
1.0.0-beta.1 Nov 8, 2021
0.1.0 Jan 25, 2016

#9 in Text processing

Download history 328716/week @ 2024-08-13 336165/week @ 2024-08-20 327756/week @ 2024-08-27 352026/week @ 2024-09-03 336437/week @ 2024-09-10 317674/week @ 2024-09-17 366244/week @ 2024-09-24 378042/week @ 2024-10-01 382119/week @ 2024-10-08 409875/week @ 2024-10-15 420788/week @ 2024-10-22 409287/week @ 2024-10-29 402684/week @ 2024-11-05 447309/week @ 2024-11-12 429017/week @ 2024-11-19 309062/week @ 2024-11-26

1,666,673 downloads per month
Used in 2,771 crates (191 directly)

MIT/Apache

525KB
7K SLoC

widestring

Crates.io Documentation Crates.io Build status

A wide string Rust library for converting to and from wide strings, such as those often used in Windows API or other FFI libaries. Both u16 and u32 string types are provided, including support for UTF-16 and UTF-32, malformed encoding, C-style strings, etc.

Macros for converting string literals to UTF-16 and UTF-32 strings at compile time are also included.

Requires Rust 1.58 or greater. If you need support for older versions of Rust, use 0.x versions of this crate.

Documentation

Optional Features

  • alloc - Enabled by default. Enable use of the alloc crate when not using the std library.

    This enables the owned string types and aliases.

  • std - Enabled by default. Enable features that depend on the Rust std library, including everything in the alloc feature.

  • debugger_visualizer Add debugger visualizer data for crate types. Requires Rust 1.71 or newer

License

This library is distributed under the terms of either of:

at your option.

This project is REUSE-compliant. Copyrights are retained by their contributors. Some files may include explicit copyright notices and/or license SPDX identifiers. For full authorship information, see the version control history.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps