Function icu_properties::maps::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