Releases: Juici/wchar-rs
0.11.0
0.10.1
Features
-
Add support for character literals in
wch
macro.The
wch
macro 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_wch
andinclude_wchz
macros.These macros function similarly to the
include_bytes
macro. 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
unstable
feature is required.
0.8.0
Breaking changes
-
Renamed
wch_c
macro towchz
.This brings the macro more inline with nul-terminated string terminology, such as
.ascii
and.asciiz
in assembly. -
Default to target platform
wchar_t
for macro output.To make the macros more usable the output wide character type when not specified in the macro will default to the
wchar_t
type 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");