[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: String comparison
- From: Klaus Ripke <paul-lua@...>
- Date: Fri, 18 Dec 2009 14:19:14 +0100
On Fri, Dec 18, 2009 at 01:09:12PM +0000, Matthew Wild wrote:
> 2009/12/18 Andreas Falkenhahn <email@example.com>:
> > Is there any specific reason why lua does string comparison in
> > this way? I.e. giving lower case characters a higher priority than
> > all of the upper case characters? I.e. the following is TRUE:
> Can you name a language which /doesn't/ do it this way?
hmmm ... Lua?
"if both arguments are strings,
then their values are compared according to the current locale"
Plain ASCII sort order by byte value is usually used in the C locale
(but byte values could as well be EBCDIC, so don't count on it).
Depending on your libc, other locales may use proper collations
treating case as a secondary property
(basically kicking in only if values are equal ignoring case).
Try setting LANG, LC_ALL and friends to other locales.