icu_properties::maps

Function script

Source
pub const fn script() -> CodePointMapDataBorrowed<'static, Script>
Expand description

Return a CodePointMapDataBorrowed for the Script Unicode enumerated property. See Script.

Note: Some code points are associated with multiple scripts. If you are trying to determine whether a code point belongs to a certain script, you should use load_script_with_extensions_unstable and ScriptWithExtensionsBorrowed::has_script instead of this function.

โœจ Enabled with the compiled_data Cargo feature.

๐Ÿ“š Help choosing a constructor

ยงExample

use icu::properties::{maps, Script};

assert_eq!(maps::script().get('ๆœจ'), Script::Han);  // U+6728
assert_eq!(maps::script().get('๐ŸŽƒ'), Script::Common);  // U+1F383 JACK-O-LANTERN