normalize

Function normalize 

Source
pub fn normalize(c: char) -> char
Expand description

Normalize a Unicode character by converting Latin characters which are variants of ASCII characters to their Latin equivalents.

Note that this method acts on single chars: if you want to perform full normalization, you should first split on graphemes, and then normalize each grapheme by normalizing the first char in each grapheme. See the graphemes function for more detail.

If a character does not normalize to a single ASCII character, no normalization is performed.

This performs normalization within the following Unicode blocks:

If the character does not fall in any of these blocks, it is not normalized.

§Example

assert_eq!(normalize('ä'), 'a');
assert_eq!(normalize('Æ'), 'Æ');
assert_eq!(normalize('ữ'), 'u');