6 个版本 (重大更改)

0.11.0 2021年8月9日
0.10.0 2021年5月14日
0.9.0 2021年5月12日
0.8.0 2021年5月5日
0.5.0 2019年7月22日

31#utf-16

Download history • Rust 包仓库 3374/week @ 2024-04-07 • Rust 包仓库 2493/week @ 2024-04-14 • Rust 包仓库 3680/week @ 2024-04-21 • Rust 包仓库 3050/week @ 2024-04-28 • Rust 包仓库 1515/week @ 2024-05-05 • Rust 包仓库 2554/week @ 2024-05-12 • Rust 包仓库 2025/week @ 2024-05-19 • Rust 包仓库 2376/week @ 2024-05-26 • Rust 包仓库 3174/week @ 2024-06-02 • Rust 包仓库 2568/week @ 2024-06-09 • Rust 包仓库 2016/week @ 2024-06-16 • Rust 包仓库 1158/week @ 2024-06-23 • Rust 包仓库 1633/week @ 2024-06-30 • Rust 包仓库 2031/week @ 2024-07-07 • Rust 包仓库 1485/week @ 2024-07-14 • Rust 包仓库 2164/week @ 2024-07-21 • Rust 包仓库

7,395 每月下载量
8 个crate中使用 (通过 wchar)

MIT/Apache

12KB
308 代码行

wchar

build status crates.io docs.rs

此库引入了两个宏,在编译时创建UTF-16和UTF-32宽字符串,类似于C中的L字符串字面量。

[dependencies]
wchar = "0.10"

编译器支持:需要rustc 1.53+

示例

use wchar::{wch, wchz, wchar_t};

// Equivalent to `#define RUST L"Rust"` in C.
const RUST: &[wchar_t] = wch!("Rust\0"); // C strings are nul-terminated.
// Equivalent to `#define ALSO_RUST L"Rust"` in C.
const ALSO_RUST: &[wchar_t] = wchz!("Rust");

assert_eq!(RUST, &['R' as wchar_t, 'u' as wchar_t, 's' as wchar_t, 't' as wchar_t, 0x0000]);
assert_eq!(RUST, ALSO_RUST);

许可协议

此项目受Apache License 2.0或MIT License许可,您可选择其中之一。

贡献

除非您明确声明,否则您提交的任何有意包含在作品中的贡献,根据Apache-2.0许可定义,将按上述方式双重许可,不附加任何额外条款或条件。

依赖项

~1.5MB
~35K SLoC