Crate unic_char_basics

Source
Expand description

§UNIC — Unicode Character Tools — Basic Stable Character Properties

A simple way to control iteration over a range of characters.

§Examples

extern crate unic_char_basics;
use unic_char_basics::{is_noncharacter, is_private_use};

// Plane 0 (BMP)
assert_eq!(is_noncharacter('\u{0}'), false);
assert_eq!(is_noncharacter('\u{80}'), false);
assert_eq!(is_noncharacter('\u{e000}'), false);
assert_eq!(is_noncharacter('\u{f8ff}'), false);
assert_eq!(is_noncharacter('\u{fdd0}'), true);
assert_eq!(is_noncharacter('\u{fdef}'), true);
assert_eq!(is_noncharacter('\u{fffd}'), false);
assert_eq!(is_noncharacter('\u{fffe}'), true);
assert_eq!(is_noncharacter('\u{ffff}'), true);

assert_eq!(is_private_use('\u{0}'), false);
assert_eq!(is_private_use('\u{80}'), false);
assert_eq!(is_private_use('\u{e000}'), true);
assert_eq!(is_private_use('\u{f8ff}'), true);
assert_eq!(is_private_use('\u{fdd0}'), false);
assert_eq!(is_private_use('\u{fdef}'), false);
assert_eq!(is_private_use('\u{fffd}'), false);
assert_eq!(is_private_use('\u{fffe}'), false);
assert_eq!(is_private_use('\u{ffff}'), false);

// Plane 16 (PUA-B)
assert_eq!(is_noncharacter('\u{10_0000}'), false);
assert_eq!(is_noncharacter('\u{10_0001}'), false);
assert_eq!(is_noncharacter('\u{10_fffd}'), false);
assert_eq!(is_noncharacter('\u{10_fffe}'), true);
assert_eq!(is_noncharacter('\u{10_ffff}'), true);

assert_eq!(is_private_use('\u{10_0000}'), true);
assert_eq!(is_private_use('\u{10_0001}'), true);
assert_eq!(is_private_use('\u{10_fffd}'), true);
assert_eq!(is_private_use('\u{10_fffe}'), false);
assert_eq!(is_private_use('\u{10_ffff}'), false);

Re-exports§

Modules§

  • Unicode Noncharacters
  • Format Unicode Code-Points in the style recommended by The Unicode Standard.
  • Unicode Private-Use Characters

Constants§