Skip to content

0.10.1

Compare
Choose a tag to compare
@Juici Juici released this 14 May 12:19
· 5 commits to master since this release
34671d6

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 and include_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.