lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Dec 18, 2009 at 01:09:12PM +0000, Matthew Wild wrote:
> 2009/12/18 Andreas Falkenhahn <andreas@airsoftsoftwair.de>:
...
> > 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"
http://www.lua.org/manual/5.1/manual.html#2.5.2

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.


regards
Klaus