Bug 437012 - Wrong language when LANG and LC_MESSAGES differ...
Wrong language when LANG and LC_MESSAGES differ...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
10
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks: F10Target
  Show dependency treegraph
 
Reported: 2008-03-11 12:57 EDT by Dmitry Butskoy
Modified: 2009-07-30 10:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-30 10:47:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (900 bytes, patch)
2008-03-11 12:57 EDT, Dmitry Butskoy
no flags Details | Diff

  None (edit)
Description Dmitry Butskoy 2008-03-11 12:57:21 EDT
All F7,F8 and rawhide versions seem to be affected (1.2.12-1.3.6)

Preamble:

There is a wide-spread locale settings, popular for developers, where the LANG
is set according to the true native language (as usual), but LC_MESSAGES is set
to "C" . 

This way programs know the local language and character set properly, but all
the messages for a user are in English (because of "C" locale), not the native
language.


Unfortunately, the Cups code interpretes LC_MESSAGES in some non-standard way.
It tries to determine the WHOLE locale language first just by LC_MESSAGES (not
by LC_ALL or LANG, as it should be). It seems not correct anyway.

In the currect Cups code, if you set in /etc/sysconfig/i18n, say
LANG=de_DE.UTF-8 and LC_MESSAGES=C , the "attributes-natural-languages" appears
to be "c-" broken string. Then the LANG variable in the Cups filters and
backends appears as "c-" too, which leads to leak of locale support at all.

The LANG/LC_MESSAGES combination above is correct. Cups must know the actual
locale language (and choose proper fonts, encodings etc.), but the user/logfile
messages ONLY (diagnostic, info etc.) should be in "C" locale.


Steps to Reproduce:

1. Wrote a shell wrapper around any of /usr/lib/cups/filters/, say texttopaps,
which will output the actual runtime environment

#!/bin/sh

env >>/tmp/env.dump
exec $0.orig "$@"


2. Print something (which will touch the wrapped filter) with the locale
settings described above:

LANG=de_DE.UTF-8 LC_MESSAGES=C lpr some_file


3. In the /tmp/env.dump you will see the "LANG=c-" strange values...

I've made a patch, which seems to fix the issue. See the patch and comments in
it for more info.
Comment 1 Dmitry Butskoy 2008-03-11 12:57:22 EDT
Created attachment 297644 [details]
Proposed patch
Comment 2 Bug Zapper 2008-05-14 01:57:05 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Tim Waugh 2008-05-28 05:23:08 EDT
Deferring to rawhide.
Comment 4 Dmitry Butskoy 2008-08-14 11:21:05 EDT
Since Fedora 8 (ie. cups-1.3.7), the wrong language now appears as "c-.UTF8" instead of "c-". This ".UTF8" seems to improve the situation.

IOW, whilst the issue still exists (formally wrong LANG variable), this issue no more affects the end user, as the "magic addon" of ".UTF8" causes all the backends to work properly.

If you have a contact, please, report this upstream. Then I think we can "close upstream" this one...
Comment 5 Bug Zapper 2008-11-25 21:09:00 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Tim Waugh 2009-07-30 10:47:09 EDT
In Fedora 10 it seems to be 'C.UTF8', which at least seems valid.

Note You need to log in before you can comment on or make changes to this bug.