Get the latest tech news

The macOS LC_COLLATE hunt: Or why does sort order differently on macOS and Linux (2020)


, why does sort(1) order differently on macOS and Linux? Zhiming Wang 2020-06-03 Today I noticed something interesting while working with a sorted list of package names: sort(1) orders them differently on macOS and Linux (Ubuntu 20.04). A very simple example, with locale set explicitly: (macOS) $ LC_ALL=en_US.UTF-8 sort <<<$'python-dev\npython3-dev' python-dev python3-dev (Linux) $ LC_ALL=en_US.UTF-8 sort <<<$'python-dev\npython3-dev' python3-dev python-dev What the hell? Same locale, different order (or technically, collation).

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Linux

Linux

Related news:

News photo

New Code Merged For Linux 6.18 To Address Linus Torvalds' Rust Formatting Critique

News photo

Windows 10 Refugees Flock To Linux as Zorin OS Claims 'Biggest Launch Ever'

News photo

Linux Display Driver Patches Posted For The Qualcomm Snapdragon X2 Elite