#string #c-style #wide #compile-time #c-strings #widestring

u16cstr

A macro for creating c-style u16 wide strings at compile time

8 unstable releases (3 breaking)

0.5.0 Jun 22, 2022
0.4.0 Jun 21, 2022
0.3.1 Jun 7, 2022
0.3.0 Oct 14, 2021
0.1.1 Jul 30, 2021

#2420 in Rust patterns

Download history 4/week @ 2024-11-27 38/week @ 2024-12-04 25/week @ 2024-12-11 8/week @ 2024-12-18 13/week @ 2025-01-01 51/week @ 2025-01-08 40/week @ 2025-01-15 48/week @ 2025-01-22 9/week @ 2025-02-05 41/week @ 2025-02-19 14/week @ 2025-02-26

64 downloads per month

MIT license

6KB

u16cstr

Build crates.io Documentation dependency status MIT

A macro for creating c-style u16 wide strings at compile time.

Example

use u16cstr::{u16cstr, u16str};
use widestring::{U16CString, U16String, U16CStr, U16Str};

// c-style terminated wide string
const wide_c_string: &U16CStr = u16cstr!("Test");
assert_eq!(wide_c_string, U16CString::from_str("Test").unwrap().as_ucstr());

// non-terminated wide string
const wide_string: &U16Str = u16str!("Test");
assert_eq!(wide_string, U16String::from_str("Test").as_ustr());

License

Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)

Dependencies

~2MB
~45K SLoC