const-utf16 0.2.1

Utf8 to utf16 conversion functions for use in const contexts
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 1 items with examples
  • Size
  • Source code size: 20.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 569.84 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • rylev/const-utf16
    15 2 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rylev

crates.io docs.rs Build and Test

const-utf16

utf8 to utf16 conversion functions useable in const contexts.

Use

const HELLO_WORLD_UTF16: &[u16] = const_utf16::encode!("Hello, world!");

Minimum Supported Rust Version (MSRV)

This crate requires Rust 1.46.0 or newer due to the use of some const expression features.

Attribution

This code is largely inspired by the Rust core utf16 conversion code.