Releases: Juici/wchar-rs
0.11.0
0.10.1
Features
-
Add support for character literals in
wchmacro.The
wchmacro now accepts character literals and outputs single wide characters.use wchar::{wch, wchar_t}; const A: wchar_t = wch!('A'); const B: u16 = wch!(u16, 'B'); const C: u32 = wch!(u32, 'C'); const D: i16 = wch!(i16, 'D'); const E: i32 = wch!(i32, 'E');
-
Add
include_wchandinclude_wchzmacros.These macros function similarly to the
include_bytesmacro. The macros read UTF-8 encoded files and generate a slice of wide characters.use wchar::include_wch; // Include a UTF-8 encoded file as a UTF-16 encoded u16 slice. const FILE_AS_UTF16: &[u16] = include_wch!(u16, "/path/to/file.txt");
Unstable: Currently this limited to absolute paths, in order to use relative paths the
unstablefeature is required.
0.8.0
Breaking changes
-
Renamed
wch_cmacro towchz.This brings the macro more inline with nul-terminated string terminology, such as
.asciiand.asciizin assembly. -
Default to target platform
wchar_tfor macro output.To make the macros more usable the output wide character type when not specified in the macro will default to the
wchar_ttype of the target platform. This is instead of the previous default ofu16.The crate also exports a type alias to the default target platform
wchar_t, this can be used as such:use wchar::{wchz, wchar_t}; const RUST: &[wchar_t] = wchz!("Rust");