https://github.com/openbytedev/u16cstr
A macro for creating c-style u16 wide strings at compile time.
https://github.com/openbytedev/u16cstr
Last synced: about 1 year ago
JSON representation
A macro for creating c-style u16 wide strings at compile time.
- Host: GitHub
- URL: https://github.com/openbytedev/u16cstr
- Owner: OpenByteDev
- License: mit
- Created: 2021-07-30T13:05:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T15:18:15.000Z (almost 4 years ago)
- Last Synced: 2025-04-13T03:15:24.519Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# u16cstr
[](https://github.com/OpenByteDev/u16cstr/actions/workflows/build-and-test.yml)
[](https://crates.io/crates/u16cstr)
[](https://docs.rs/u16cstr)
[](https://deps.rs/repo/github/openbytedev/u16cstr)
[](https://github.com/OpenByteDev/u16cstr/blob/master/LICENSE)
A macro for creating c-style u16 wide strings at compile time.
## Example
```rust
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](https://github.com/OpenByteDev/u16cstr/blob/master/LICENSE) or http://opensource.org/licenses/MIT)