GNOME Bugzilla – Bug 142852
Print dialog is broken in non-UTF8 locale
Last modified: 2009-09-10 07:08:31 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.
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.
Created attachment 27883 [details] Print dialog with sv_SE.utf8 locale This is correct.
Does this happen with the print dialog only? What version of gimpprint are you using?
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.
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.
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.
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?
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()
The problem seems to be specific to Fedora then since I can not reproduce it on Debian sid.
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.
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.
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.
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.
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.
I've reported it against Fedora gettext now as https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124204.
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
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();
This issue seems to have been fixed in the Fedora packages. Closing as NOTGNOME.
*** Bug 593414 has been marked as a duplicate of this bug. ***
sorry for that. nevermind.