#415961 locales: Sorting with pt_BR ignoring spaces - it shouldn't

Package:
locales
Source:
glibc
Submitter:
Daniel Cristian Cruz
Date:
2025-01-23 17:51:02 UTC
Severity:
normal
Tags:
#415961#5
Date:
2007-03-23 11:48:27 UTC
From:
To:
When sorting data, the sort order ignore spaces, being very anoying to use it with a database like PostgreSQL.

Below an example:

$ cat list.txt # A random name list
Adriano José
Adriana da Silva
Adrian Kuerten

The strange behavior:

$ cat lista.txt | sort
Adriana da Silva
Adrian Kuerten
Adriano José

Changing /usr/share/i18n/locales/pt_BR, section LC_COLLATE to:

LC_COLLATE
copy "iso14651_t1"
reorder-after <U00A0>
<U0020><CAP>;<CAP>;<CAP>;<U0020>
reorder-end
END LC_COLLATE

I have the correct behavior:

$ cat lista.txt | sort
Adrian Kuerten
Adriana da Silva
Adriano José

There is a topic in http://sourceware.org/bugzilla/show_bug.cgi?id=3405, but the pt_BR file there doesn't work well with chars 'a','á','ã',etc...

I think this could be a problem for other languages too, but not for sure.