On Mon, Jun 17, 2013 at 09:36:55AM +0200, Jérémie Courrèges-Anglas wrote:
> Hi folks,
> 
> when looking at locale(1) former output formatting one could notice that
> setlocale(LC_ALL, NULL) look "weird". It encodes the whole current
> locale configuration so that it can be reused later.  POSIX doesn't say
> much - afaik - about the formatting, and that is a point where we differ
> from, for example, the glibc.
> 
> So if you know of a program that messes up with the string returned by
> the above it is probably wrong.  A grep -sR 'setlocale *(LC_ALL, *NULL)'
> over the full ports source tree could prove useful.
> 
> Example of setlocale(LC_ALL, NULL) output and toy program:
> C/fr_FR.UTF-8/C/C/C/C

Let me add some information to this:

This output was inherited from NetBSD in the first revision of
libc/locale/setlocale.c.

Please keep in mind that printing something like LC_ALL=fr_FR.UTF-8
on OpenBSD would be a lie. I don't think we should do this. We only
support values other than "C" for LC_CTYPE. Other systems support
(or claim to support) more locale categories than we do, so they
might treat LC_ALL differently.

I'm fine with changing this to whatever today's convention is if
that is required for removing lots of patches from ports. But anyone
wishing to change the current output, please don't look at just glibc
for example output, and please don't make OpenBSD's libc lie about
what it supports unless there is a very good reason to do so.

Reply via email to