Unicode Collation Référence
Référence pour Unicode Collation Algorithme (UCA) et locale-aware chaîne sorting.
Collation Algorithm
The Unicode Collation Algorithm (UCA, UTS #10) provides locale-aware string comparison. It uses a Default Collation Element Table (DUCET) mapping characters to sort weights. Multi-level comparison: primary (base character), secondary (accent), tertiary (case), quaternary (compatibility). Tailoring customizes DUCET for specific locales (e.g., German phonebook, Spanish ch as a digraph). The algorithm handles contractions, expansions, and ignorable characters. ICU implements UCA with extensive locale support.
- UCA
- Collation algorithm
- DUCET
- Default weights
- tailoring
- Locale customization
UTS #10 base table German, Spanish Implementation and Use
JavaScript Intl.Collator provides locale-aware comparison with options for sensitivity and numeric sorting. Numeric collation sorts "file2" before "file10" (natural sort). Case-first and accent-first options control tertiary/secondary weight order. Search collation (sensitivity: base) ignores accents and case for matching. Database collation should match application expectations. Sorting performance varies; precompute sort keys for large datasets. Always use Intl.Collator or ICU, never raw code point comparison, for user-facing sorting.
- Intl.Collator
- JS API
- numeric
- Natural sort
- search
- Sensitivity: base
locale-aware file2 < file10 ignore accents