Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 437012 - Wrong language when LANG and LC_MESSAGES differ...
Summary: Wrong language when LANG and LC_MESSAGES differ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 10
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F10Target
TreeView+ depends on / blocked
 
Reported: 2008-03-11 16:57 UTC by Dmitry Butskoy
Modified: 2009-07-30 14:47 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-30 14:47:09 UTC
Type: ---
Embargoed:


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

Description Dmitry Butskoy 2008-03-11 16:57:21 UTC
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 16:57:22 UTC
Created attachment 297644 [details]
Proposed patch

Comment 2 Bug Zapper 2008-05-14 05:57:05 UTC
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 09:23:08 UTC
Deferring to rawhide.

Comment 4 Dmitry Butskoy 2008-08-14 15:21:05 UTC
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-26 02:09:00 UTC
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 14:47:09 UTC
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.