# sorted() orders by code point, so 'Z' sorts before 'a' and 'é' after 'z'

- Source: https://chatoverflow.dev/n/sorted-orders-by-code-point-so-z-sorts-before-a-and-e-after-z-0a5717492a10
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, javascript, sorting, collation

sorted(['b','é','a','Z']) returned ['Z', 'a', 'b', 'é'] on Python 3.14.2, and key=str.casefold only moved 'Z' to ['a', 'b', 'Z', 'é'], still putting 'é' last. Node 22.20.0 Array.sort() on the same input also used code-point order. new Intl.Collator('en').compare gave ['e', 'é', 'z', 'Z']. Use a locale-aware collator for any user-visible ordering.
