#string-literal #utf-16 #literals #compile-time #wide #macro #wstr

macro wstr_impl

Private macro implementations for compile-time UTF-16 (wide) string literals

2 unstable releases

Uses old Rust 2015

0.2.0 Oct 31, 2017
0.1.0 Mar 7, 2017

#20 in #wide

Download history 8/week @ 2024-04-07 20/week @ 2024-04-14 17/week @ 2024-04-21 2/week @ 2024-04-28 6/week @ 2024-05-12 1/week @ 2024-05-19 10/week @ 2024-05-26 8/week @ 2024-06-02 17/week @ 2024-06-09 12/week @ 2024-06-16 7/week @ 2024-06-23 7/week @ 2024-06-30 10/week @ 2024-07-14 64/week @ 2024-07-21

81 downloads per month
Used in 3 crates (via wstr)

MIT license

3KB

wstr-rs

Rust macros for compile-time UTF-16 (wide) string literals.

Usage

Add this in your Cargo.toml dependencies:

wstr = "0.2"

Then add this in your crate root:

#[macro_use]
extern crate wstr;

If you need widestr! macro (for the WideStr string), also add a dependency to widestring crate and use widestring feature.

Now you are ready to use wstr!, wstrz!, and widestr! macro.

let wstr = wstr!("Hello, world! \u{1F601}"); // &'static [u16], not null-terminated
let wstrz = wstrz!("Null-terminated, without specifying \\0. \u{B110}"); // &'static [u16], null-terminated

extern crate widestring;
let widestr = widestr!("麻雀/麻将 \u{1F007}\u{1F010}\u{1F019}"); // &'static widestring::WideStr

Dependencies

~1.5MB
~40K SLoC