| Crates.io | u16cstr |
| lib.rs | u16cstr |
| version | 0.6.0 |
| created_at | 2021-07-30 13:31:32.810239+00 |
| updated_at | 2025-12-07 01:54:20.892176+00 |
| description | A macro for creating c-style u16 wide strings at compile time. |
| homepage | https://github.com/OpenByteDev/u16cstr |
| repository | https://github.com/OpenByteDev/u16cstr |
| max_upload_size | |
| id | 429290 |
| size | 9,908 |
A macro for creating c-style u16 wide strings at compile time.
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());
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)