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

Bug#522776: debian-policy: mandate existence of a standardised UTF-8 locale



On Wed, Apr 08, 2009 at 10:22:15AM +0200, Giacomo A. Catenazzi wrote:
> Roger Leigh wrote:
>> On Tue, Apr 07, 2009 at 09:24:38PM +0200, Adeodato Simó wrote:
>>> + Thorsten Glaser (Tue, 07 Apr 2009 18:54:59 +0000):
>>>
>>>> Except the ton which sets LC_ALL=C to get sane (parsable,
>>>> dependable, historically compatible) output.
>>>> These would then unset all other LC_* and LANG and LANGUAGE,
>>>> and only set LC_CTYPE to C.UTF-8 to get "old" behaviour but
>>>> with UTF-8 (and mbrtowc and iswctype and and and) available.
>>> Isn’t setting LC_ALL=C.UTF-8 going to be about the same and less work?
>>> I’m genuinely interested if that would behave any different to what you
>>> said (unsetting all, setting LC_CTYPE).
>>
>> % sudo localedef -c -i POSIX -f UTF-8 C.UTF-8
>>
>> % LANG=C.UTF8 locale charmap
>> UTF-8
>>
>> % LANG=C locale charmap
>> ANSI_X3.4-1968
>>
>> This appears to work correctly at first glance.
>>
>> However, I would ideally like the C/POSIX locales to be UTF-8
>> by default as on other systems (with a C.ASCII variant if required).
>
> POSIX doesn't mandate "C" to be ASCII7.
>
> BTW ASCII7 is a subset of UTF-8, so what would be different with
> normal "C"?  I don't expect any differences on any program (which
> are POSIX compatible). The output characters will still be only on
> the c<128 range.

Exactly.  For a conforming program only using c<128, there will
be zero differences running in a UTF-8 C locale and running and
an ASCII C locale, just like there are no differences today when
running in any UTF-8 locale (except maybe collation, but for the
UTF-8 C locale we would need to keep it fully backward compatible
with the existing behaviour).

However, what is different is that programs may /optionally/ choose
to use the UTF-8 superset of ASCII7 and have output and string
formatting and wide/narrow character conversion work correctly.
This is what is currently lacking.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.



Reply to: