Crate icu_casemap
source ·Expand description
Case mapping for Unicode characters and strings.
This module is published as its own crate (icu_casemap
)
and as part of the icu
crate. See the latter for more details on the ICU4X project.
§Examples
use icu::casemap::CaseMapper;
use icu::locid::langid;
let cm = CaseMapper::new();
assert_eq!(
cm.uppercase_to_string("hello world", &langid!("und")),
"HELLO WORLD"
);
assert_eq!(
cm.lowercase_to_string("Γειά σου Κόσμε", &langid!("und")),
"γειά σου κόσμε"
);
Re-exports§
pub use titlecase::TitlecaseMapper;
Modules§
- closer 🔒
- This module contains most of the actual algorithms for case mapping.
- 🚧 [Unstable] Data provider struct definitions for this ICU4X component.
- set 🔒
- Titlecasing-specific try_new_with_mapper_unstable
Structs§
- A wrapper around
CaseMapper
that can produce case mapping closures over a character or string. This wrapper can be constructed directly, or by wrapping a reference to an existingCaseMapper
. - A struct with the ability to convert characters and strings to uppercase or lowercase, or fold them to a normalized form for case-insensitive comparison.
Traits§
- An object that accepts characters and/or strings to be used with
CaseMapCloser::add_string_case_closure_to()
andCaseMapCloser::add_case_closure_to()
. Usually this object will be some kind of set over codepoints and strings, or something that can be built into one.