wchar

build status crates.io docs.rs

This library introduces two macros to create UTF-16 and UTF-32 wide strings at compiler time, like L string literals in C.

toml [dependencies] wchar = "0.7"

Compiler support: requires rustc 1.45+

Example

```rust use wchar::{wch, wch_c};

// Equivalent to #define RUST L"Rust" in C. const RUST: &[u16] = wchc!("Rust"); asserteq!(RUST, &[0x0052, 0x0075, 0x0073, 0x0074, 0x0000]); assert_eq!(RUST, wch!("Rust\0")); ```

License

This project is licensed under either of Apache License, Version 2.0 or MIT License at your option.

Contribution

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.