expression

Canonical normalization — NFC

NFC creates a canonical composed representation where possible. Canonically equivalent strings can then compare equally; this does not implement language-specific search policies. Expected stdout (not executed): false true Common mistake: Assuming NFC removes all accents or unifies different Arabic and Persian letters.

Formal Syntax & Structure

rust syntaxrust
text.nfc().collect::<String>()

Working Example

Example Snippetrust
fn main() {    use unicode_normalization::UnicodeNormalization;    let a = "e\u{0301}";    let b = "é";    let normalized: String = a.nfc().collect();    println!("{} {}", a == b, normalized == b);}
Rust Reference