Skip to content

build_image: set en_US locale by default

Pablo Correa Gomez requested to merge en-us-locale into master

In theory, the en_US locale is supposed to be aimed at people, while the C locale is aimed as computers. In theory, one of the remarkable differences is in sorting:

$ printf '%s\n' \| a \0 \^ \& B c C | LC_COLLATE=C.UTF-8 sort
&
0
B
C
^
a
c
|

The non-sense there is obvious, with "^" sorting in between the letters, "|" afterwards and sorting of capitals and non-capitals split. The reason is the ordering is based on the ascii table. In theory, an en_US locale should be able to provide a sensitive ordering, but what takes care of it is the libc, and musl does not have it properly implemented. So LC_COLLATE=en_US will still give the same results. However, that's hopefully going to change at some point, and there's no harm in setting a sensible locale by default in images aimed at users.

Merge request reports