After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 142852 - Print dialog is broken in non-UTF8 locale
Print dialog is broken in non-UTF8 locale
Status: RESOLVED NOTGNOME
Product: GIMP
Classification: Other
Component: Internationalisation
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-05-20 16:39 UTC by Göran Uddeborg
Modified: 2009-09-10 07:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Print dialog in sv_SE (ISO-8859-1) locale (58.41 KB, image/png)
2004-05-20 16:43 UTC, Göran Uddeborg
Details
Print dialog with sv_SE.utf8 locale (70.47 KB, image/png)
2004-05-20 16:45 UTC, Göran Uddeborg
Details

Description Göran Uddeborg 2004-05-20 16:39:19 UTC
I still have to use the legacy locale sv_SE, which uses ISO-8859-1.  When I run
the new gimp in this locale, the print dialog is completely broken.  Strings
containing non-ASCII characters are truncated before the non-ASCII characters. 
Some multi line button texts disappear completely.  See the attached pictures
for details.
Comment 1 Göran Uddeborg 2004-05-20 16:43:26 UTC
Created attachment 27882 [details]
Print dialog in sv_SE (ISO-8859-1) locale

Even without knowing Swedish, I suppose you can imagine the single "F" up on
the left is not a complete word.  The buttons with only "B" and "St"., and the
label "H" are other examples of broken strings, as are the empty buttons at the
bottom.
Comment 2 Göran Uddeborg 2004-05-20 16:45:53 UTC
Created attachment 27883 [details]
Print dialog with sv_SE.utf8 locale

This is correct.
Comment 3 Sven Neumann 2004-05-20 16:58:38 UTC
Does this happen with the print dialog only?

What version of gimpprint are you using?
Comment 4 Göran Uddeborg 2004-05-20 17:04:23 UTC
Yes, this applies ONLY to the print dialog.  All other dialogs look normal in
both locales.  (All I've used so far, at least.)

I don't have any package literally named "gimpprint", but there is one named
"gimp-print".  That's what you refer to, right?  The version I have is
gimp-print-4.2.6-11.
Comment 5 Sven Neumann 2004-05-20 19:05:24 UTC
I'm not really sure what's happening here but I am afraid this misbehaviour
might be related to the fact that libgimpprint fiddles with the locales in order
to work around some locale-dependant problems (see bug #125283). If I remember
correctly the libgimpprint does not only change LC_NUMERIC (which should have
been sufficient) but LC_ALL.
Comment 6 Sven Neumann 2004-05-20 19:06:55 UTC
Here's the link to the bug-report and the patch: 

http://sourceforge.net/tracker/?group_id=1537&atid=101537&func=detail&aid=729918

If this is really the problem then this bug needs to be fixed in gimpprint.
Comment 7 Sven Neumann 2004-05-20 19:15:36 UTC
I've now tried gimp-2.0 with libgimpprint-4.2.6 in several non-UTF-8 and UTF-8
locales including sv_SE (ISO-8859-1) and can not reproduce your problem.

Can you please check if there's any console output when opening the print dialog?
Comment 8 Christian Rose 2004-05-21 08:21:30 UTC
I can confirm this. I tested it with gimp-2.0.1-3 and gimp-print-4.2.6-11 on
Fedora Core 2. When I run

$ LANG=sv_SE LC_ALL=sv_SE gimp &

and then bring forward the print dialog, all strings containing non-ASCII
characters are being truncated, and lots of errors like these are being repeated
in the console:

(print:3682): Gtk-WARNING **: Invalid input string
** (print:3682): WARNING **: Invalid UTF8 string passed to pango_layout_set_text()
Comment 9 Sven Neumann 2004-05-21 09:42:22 UTC
The problem seems to be specific to Fedora then since I can not reproduce it on
Debian sid.
Comment 10 Sven Neumann 2004-05-21 09:44:02 UTC
Can you guys please check if changing the code in gimpprint from using LC_ALL to
LC_NUMERIC fixes this problem? If that's the case then a bug report against
gimpprint should be opened and this report be closed as NOTGNOME.
Comment 11 Göran Uddeborg 2004-05-21 20:50:30 UTC
I very much doubt it could be related to the setlocale fix you mention in
comment 6; it only goes to locale C for a single call of (some) print function,
and then goes back again.

To rule out any eventualities, I anyway tried to rebuild gimp-print with the fix
changed to only modify LC_NUMERIC.  I got some problems during the configure
step.  I'll investigate why, but not tonight.
Comment 12 Sven Neumann 2004-05-22 10:26:38 UTC
My guess is that the call to setlocale() triggers a bug in your libc. It seems
that changing the locale somehow changes the character encoding for gettext()
calls that was set to UTF-8 earlier using bind_textdomain_codeset(). But that's
just a wild guess.
Comment 13 Göran Uddeborg 2004-05-23 21:37:27 UTC
Now I've rebuild gimp-print and replaced the LC_ALL setting with an LC_NUMERIC
setting.  The print dialog is still broken the same way.

I also tried removing the setlocale calls in this particular patch completely.
Still no change.

My own conclusion is that the patch mentioned in comment 6 is not related to the
problems I describe in this report.
Comment 14 Sven Neumann 2004-05-24 07:16:54 UTC
OK, so at least we know that now. Did anyone contact the Fedora developers yet?
Since this looks very much like a bug in the gettext routines, it should be
reported there.
Comment 15 Christian Rose 2004-05-24 17:24:36 UTC
I've reported it against Fedora gettext now as
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124204.
Comment 16 Göran Uddeborg 2004-06-10 21:56:25 UTC
While not related to the particular patch you mentioned, it does seems to be
related to gimp-print as you suspected.  Tim Waugh has filed a report:
 
https://sourceforge.net/tracker/index.php?func=detail&aid=968083&group_id=1537&atid=101537
Comment 17 Sven Neumann 2004-06-11 11:31:04 UTC
The patch attached to that bug-report shouldn't be needed because the gimp print
plug-in does this call already:

 /*
  * Initialise libgimpprint
  */

  stp_init ();

  bind_textdomain_codeset ("gimp-print", "UTF-8");

  INIT_I18N();
Comment 18 Sven Neumann 2005-03-22 12:32:18 UTC
This issue seems to have been fixed in the Fedora packages. Closing as NOTGNOME.
Comment 19 Heinrich Müller 2009-09-10 04:45:54 UTC
*** Bug 593414 has been marked as a duplicate of this bug. ***
Comment 20 Heinrich Müller 2009-09-10 07:08:31 UTC
sorry for that. nevermind.