3.6. Unicode normalization and canonical caseless comparison

Module unicode_text

3.6.1. Constants

UNICODE_TEXT_VERSION = "17.0.0"

UNICODE_TEXT_VERSION:string const

UNICODE_CASELESS_KEY_VERSION = "unicode-17.0.0-d145-1"

UNICODE_CASELESS_KEY_VERSION:string const

3.6.2. Normalization and case folding

try_unicode_casefold(value: string; result: string& ): bool

Full default, locale-independent Unicode case folding. Invalid UTF-8 leaves result unchanged.

Arguments:
  • value : string

  • result : string&

try_unicode_caseless_key(value: string; result: string& ): bool

Unicode D145 canonical caseless key: NFD(casefold(NFD(value))). Invalid UTF-8 leaves result unchanged. Input and output may alias. Preserves accents; does not filter visual confusables or perform locale-specific casing. Record UNICODE_CASELESS_KEY_VERSION with persisted keys; future changes require explicit reindexing and collision handling.

Arguments:
  • value : string

  • result : string&

try_unicode_nfd(value: string; result: string& ): bool

Canonically decompose valid UTF-8 using Unicode17.0.0. Invalid UTF-8 leaves result unchanged.

Arguments:
  • value : string

  • result : string&