Skip to main content

Module unicode_normalization

Module unicode_normalization 

Source
Expand description

UTF-8 NFC path normalization for macOS-style filesystems (core.precomposeUnicode).

When the filesystem treats NFD and NFC spellings as the same path, Git stores paths in precomposed (NFC) form. This module implements the same normalization using ICU.

Functionsยง

has_non_ascii_utf8
Return true if s contains any non-ASCII UTF-8 byte.
precompose_os_string_utf8_path
Update s in place when it is valid UTF-8 and NFC differs from the current spelling.
precompose_utf8_path
Normalize every /-separated segment of path to NFC.
precompose_utf8_segment
Normalize a single path segment (no /) to NFC when it contains non-ASCII UTF-8.
probe_filesystem_normalizes_nfd_to_nfc
Probe whether creating a file under git_dir with an NFC filename makes the NFD spelling visible as the same path (macOS / HFS+ style).