Re: C library
On 2002.06.11 14:00 Helgi Örn wrote:
On Tue, 2002-06-11 at 19:42, Sean 'Shaleh' Perry wrote:
> > Wouldn't "C" be a more appropriate default locale for non-US
> sure, but you are assuming competency in coders (-: C should work
> without editing or enabling anything .
Could you guys explain for a non-programmer what this is about?
I'll give her a try...
Different parts of the world have slightly different conventions for
representing for various types of data. As an example, take the date
04/01/2002. To a brit, this is January 4th, 2002. To an american, it
is April 1st, 2002. The POSIX standard has codified all these
different conventions into something referred to as a 'locale'. It
covers things like date/time display, collation, capitalization, etc.
The POSIX standard also provides a default locale, referred to as the
'C locale'. It is very similiar to en_US, but with some important
differences. For example, when sorting in the EN_us locale, values are
sorted alphebetically, so that a word beginning with 'A' precedes a
word beginning with 'Z', regardless of case. In the C locale, Zed
precedes aleph because the character 'Z' precedes 'a' in the ASCII
encoding (this is sometimes referred to as 'ascii-betical order').
As a matter of good programming practice (following the principal of
least astonishment), if a locale is specified, that locale should be
used. If no locale is specified, or if the specified locale is not
supported by the C library (see man 3 setlocale), then the program
should fallback to the C locale. Apparently, in the case of the
application that triggered this thread, that last step wasn't followed.
So, clear as mud? ;)
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com