Crate encode_unicode [] [src]

Miscellaneous UTF-8 and UTF-16 types and methods.

Optional features:

  • #![no_std]-mode: There are a few differences:

    • AsciiExt doesn't exist, but is_ascii() is made available as an inherent impl.
    • Error doesn't exist, but description() is made available as an inherent impl.
    • Extend/FromIterator-implementations for String/Vec<u8>/Vec<u16>.
    • There is no io, so Utf8Iterator doesn't implement Read.

    This feature is enabled by setting default-features=false in Cargo.toml: encode_unicode = {version="0.3", default-features=false}

  • Integration with the ascii crate:
    Convert Utf8Char and Utf16Char to and from ascii::AsciiChar.

The minimum supported version of Rust is 1.15, older versions might work, but also break in a minor update.

crates.io page
githab repository

Modules

error

Errors returned by various conversion methods in this crate.

Structs

Utf16Char

An unicode codepoint stored as UTF-16.

Utf16Iterator

Iterate over the units of the UTF-16 representation of a codepoint.

Utf8Char

An unicode codepoint stored as UTF-8.

Utf8Iterator

Read or iterate over the bytes of the UTF-8 representation of a codepoint.

Traits

CharExt

Extension trait for char that adds methods for converting to and from UTF-8 or UTF-16.

U16UtfExt

Methods for working with u16s as UTF-16 units.

U8UtfExt

Methods for working with u8s as UTF-8 bytes.