Date: Tue, 18 Feb 2025 11:58:01 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 284864] sort does case-independent sort even without -f or --ignore-case Message-ID: <bug-284864-227-r6kwkpFCzP@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-284864-227@https.bugs.freebsd.org/bugzilla/> References: <bug-284864-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284864 --- Comment #4 from Andriy Gapon <avg@FreeBSD.org> --- Okay, I think that this should be some sort of a FAQ now. There is no problem with sort. It's just how the collation weights are defined for 'A' and 'a' inn the respective locales. E.g., for en_US.UTF-8: <a> <X2A00>;<X05>;<X05>;<a> <A> <X2A00>;<X05>;<X9C>;<A> The first two weights are equal which means that during initial comparison = of strings 'A' and 'a' would compare equal. If there are any unequal symbols (like '1', '2') they will decide the comparison result. Only if all symbols are equal, then the comparison would proceed to using second weights, then third weights, etc. And by the third weights, 'a' is smaller than 'A'. I am not sure why collation weights are defined that way, but sort certainly just obeys them. TLDR: use C locale for traditional sort order. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284864-227-r6kwkpFCzP>