| 1 |
# widestring |
| 2 |
[](https://crates.io/crates/widestring/) [](https://docs.rs/widestring/)  [](https://github.com/starkat99/widestring-rs/actions/workflows/rust.yml) |
| 3 |
|
| 4 |
A wide string Rust library for converting to and from wide strings, such as |
| 5 |
those often used in Windows API or other FFI libaries. Both `u16` and `u32` string types are |
| 6 |
provided, including support for UTF-16 and UTF-32, malformed encoding, C-style strings, etc. |
| 7 |
|
| 8 |
Macros for converting string literals to UTF-16 and UTF-32 strings at compile time are also |
| 9 |
included. |
| 10 |
|
| 11 |
*Requires Rust 1.58 or greater.* If you need support for older versions of Rust, use 0.x versions of |
| 12 |
this crate. |
| 13 |
|
| 14 |
## Documentation |
| 15 |
|
| 16 |
- [Crate API Reference](https://docs.rs/widestring/) |
| 17 |
- [Latest Changes](CHANGELOG.md) |
| 18 |
|
| 19 |
### Optional Features |
| 20 |
|
| 21 |
- **`alloc`** - Enabled by default. Enable use of the [`alloc`](https://doc.rust-lang.org/alloc/) |
| 22 |
crate when not using the `std` library. |
| 23 |
|
| 24 |
This enables the owned string types and aliases. |
| 25 |
|
| 26 |
- **`std`** - Enabled by default. Enable features that depend on the Rust `std` library, including |
| 27 |
everything in the `alloc` feature. |
| 28 |
|
| 29 |
- **`debugger_visualizer`** Add debugger visualizer data for crate types. _Requires Rust 1.71 or |
| 30 |
newer_ |
| 31 |
|
| 32 |
## License |
| 33 |
|
| 34 |
This library is distributed under the terms of either of: |
| 35 |
|
| 36 |
* [MIT License](LICENSES/MIT.txt) |
| 37 |
([http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)) |
| 38 |
* [Apache License, Version 2.0](LICENSES/Apache-2.0.txt) |
| 39 |
([http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)) |
| 40 |
|
| 41 |
at your option. |
| 42 |
|
| 43 |
This project is [REUSE-compliant](https://reuse.software/spec/). Copyrights are retained by their |
| 44 |
contributors. Some files may include explicit copyright notices and/or license |
| 45 |
[SPDX identifiers](https://spdx.dev/ids/). For full authorship information, see the version control |
| 46 |
history. |
| 47 |
|
| 48 |
### Contributing |
| 49 |
|
| 50 |
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the |
| 51 |
work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any |
| 52 |
additional terms or conditions. |