Hi,

tomr wrote on Tue, Jan 17, 2017 at 04:31:15PM +1100:

> I'm trying to get
> 
> %x    the date, using the locale's date format
> 
> to show dates as DD/MM/YYYY, but I can only get MM/DD/YYYY. I've
> (attempted to) set my locale appropriately for en_AU, and also tried
> en_GB in case that made a difference.

Everything in the locale before the dot - that is, everything
except the character encoding - is completely ignored by the base
system.  In particular, lang_REGION combinations have no effect
whatsoever for the base system.

It's not a bug, it's a feature.  We want predictable output from
the system libraries.

I should probably go and clean up the manual pages, clearly saying
that we don't do time, numeric, monetary, messages, or collate
locales.  The locale(1) manual already says so (please do read the
-current version: http://man.openbsd.org/locale.1 ), but many other
manuals still give a wrong impression.  And i should also clean up
the code, there is much stuff ifdef'ed out that we will not enable.
For example, we never define LOCALE_HOME, see:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/time/strftime.c?rev=HEAD

But it's a lot of cleanup work and not many treat it as high priority,
so that work progresses at a gentle pace.

> I've tried tweaking LC_TIME and LC_ALL both.

LC_TIME is completely ignored by the base system.
Some ports may respect it, though.

> $ locale
> LANG=en_AU.UTF-8
> LC_CTYPE="en_AU.UTF-8"
> LC_TIME=en_AU.UTF-8
> LC_MESSAGES="en_AU.UTF-8"

That's a bad idea, it will result in an inconsistent user
experience.  Some ports may do weird things, but the base system
will stay predictable.  So the user is likely to see a mixture
of (mostly) 01/17/2017 and (rarely) 17/01/2017.

I clearly recommend using LC_CTYPE=en_US.UTF-8 or LC_CTYPE=C
and nothing else.

Yours,
  Ingo

Reply via email to