[clue-tech] Directory listings and LC variables, and other LANG stuph

Jed S. Baer thag at frii.com
Mon May 1 18:19:03 MDT 2006


A few weeks ago, Dave Anselmi had remarked to me about seeing directory
listings with the hidden files interspersed, as opposed to at the
beginning of the listing. This reminded me of something else I'd seen,
which was having Upper/Lower case sorted adjacent, rather than Uppercase
at the beginning. I had messed around with this back when upgrading ... I
think from RH9 to FC3, and had found a fix, but couldn't recall the
details.

Well, here they are:
<http://www.linux.com/article.pl?sid=06/04/20/1443231>

I find that doing:
    export LC_COLLATE='POSIX'
makes directory listings sort that way I think they ought to.

There's another interesting aspect to this.
[quote]
Sort order affects not only sorting but character ranges in regular
expressions. In ASCII order, the range expression [A-Z] stands for the 26
upper-case letters. That is because the expression stands for the
characters starting with A and ending with Z. In ASCII, the upper-case
letters form a contiguous block of 26 running from A to Z. However, in the
French locale the letters starting with A and ending with Z consist of all
of the letters except for lower-case a.
[/quote]

Well, that's interesting, and certainly violates the principle of least
surprise for, I'd guess, more than a few people. Suddenly finding your
regexp doing an almost case-insensitive match could lead to some quite
unexpected results. Prior to reading this article, I'd considered
internationalization issues to be chiefly concerned wtih word translations
themselves, and character sets for various languages. Having a regexp
behave differently is a surprise, to me at least.

And I now have some hope for getting man pages to display properly in
rxvt, which apparently doesn't yet handle UTF-8.

jed
-- 
http://s88369986.onlinehome.us/freedomsight/
Key fingerprint = B027 FEFB 4281 CC72 67D1  4237 F2D0 D356 077A A30E
... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier



More information about the clue-tech mailing list