Skip to content
Skills Library
Programming · Building & coding

locale-aware-sorting

/locale-aware-sorting

Sort and compare text using locale collation rather than byte order, so lists read correctly in every language. Use when displaying sorted names, searching case-insensitively, or matching user input.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Sort and compare text using locale collation rather than byte order, so lists read correctly in every language. Use when displaying sorted names, searching case-insensitively, or matching user input.

Original author description

Sort and compare text using locale collation rather than byte order, so lists read correctly in every language. Use when displaying sorted names, searching case-insensitively, or matching user input.

How it works

  1. Method
  2. Boundaries
Original SKILL.md headings · 38 lines, 259 words
SKILL.md preview
---
name: locale-aware-sorting
description: Sort and compare text using locale collation rather than byte order, so lists read correctly in every language. Use when displaying sorted names, searching case-insensitively, or matching user input.
---

# Locale-aware sorting

Byte order is not alphabetical order in any language including English,
where it puts every uppercase letter before every lowercase one.
Accented characters, digraphs, and script-specific rules make the gap
wider, and users notice a list that sorts wrongly.

## Method

1. **Sort with a locale collator, not with a raw comparison.** The
   platform collator knows that accented letters sort near their base
   letter in most locales and separately in some.
2. **Pick the collation strength for the task.** Ignoring case and
   accents suits search matching, while a display list usually wants
   them to matter as a tiebreak.
3. **Sort in the user's locale, not the server's.** The correct order
   depends on who is reading, which means the locale travels with the
   request rather than being a deployment setting.
4. **Normalise before comparing.** The same character can be encoded
   several ways, so comparing without Unicode normalisation makes
   identical-looking strings unequal (see character-encoding).
5. **Do not lowercase to compare.** Case folding differs by locale, most
   famously with Turkish dotted and dotless i, and a naive lowercase
   changes meaning.
6. **Keep database and application collation consistent.** Sorting in SQL
   and re-sorting in the application with different rules produces
   pagination that skips and repeats rows.

## Boundaries

- Collation handles linguistic order; it does not handle domain order
  such as ranking by relevance or by a custom sequence.
- Locale-aware sorting is slower than byte comparison, which matters
  only at large scale.
- Sorting mixed-script lists has no universally correct answer, so pick
  a defensible rule and state it.

Versions

The database has no other skills named locale-aware-sorting.

Database snapshot: 13.11.2026 · package version f5d1b74afae3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90locale-formatting
    Format numbers, dates, currency, and units by locale using the platform formatter rather than string templates. Use when displaying any value whose written form differs between regions.
  • 100localize
    Write localized Elixir applications with the Localize library (hex package "localize") — formatting numbers, currencies, dates, times, durations, units of measure, lists, collation/sorting, and MessageFormat 2 messages. Use this skill whenever an Elixir app renders numbers,…
  • 100i18n
    Internationalize a project: language tags and negotiation, dates/times/time zones, numbers and currency, RTL layout, pluralization and ICU messages, collation, Unicode, and localization testing. Use when adding a language or locale, or when text, dates, numbers, or RTL layout…
  • 100vi-locale
    Build forms, validation, search, sorting and formatting that fit Vietnamese users (vi-VN): names, addresses, phone numbers, money, dates, diacritics. Use when designing or coding any of these for Vietnam, or when Vietnamese text fails to match, sort, or slug.
  • 80role-algorithms:sorting-and-searching
    Implements sorting and searching algorithms — comparison sorts (quicksort/introsort, merge sort, heapsort, Timsort), non-comparison sorts (radix, counting, bucket), binary search variants (lower/upper bound, answer-space search), order statistics (quickselect, streaming median),…
  • 100nextjs-i18n
    Best practices for multi-language handling, locale routing, and detection strategies across App and Pages Router. Use when adding i18n, locale routing, or language detection in Next.js.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.