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 172581 - gimpdata object filename problem if not representable in file name encoding
gimpdata object filename problem if not representable in file name encoding
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.2.x
Other All
: Normal major
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
: 168670 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-04-04 07:44 UTC by Tor Lillqvist
Modified: 2008-01-15 12:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tor Lillqvist 2005-04-04 07:44:38 UTC
Run GIMP 2.2 with GLib 2.4 on Win32 in a locale that uses characters that aren't
representable in the system codepage (for instance, run GIMP in Turkish on a
Western European (codepage 1252) Windows installation). When you quit, it
crashes in gimp_data_create_filename() because g_filename_from_utf8() returns
NULL because the object names are localized, and some of the localized names
contain characters not in codepage 1252.

Possible ways to fix this: Maybe gimpobject could also keep a non-localized name
for the object to be used for file names? That's probably a too big change for
the stable branch, though. Maybe gimp_data_create_filename() should use some
fallback name (hex encoded UTF-8?) if g_filename_from_utf8() returns NULL?

This problem probably can occur also on Unix, if you have a non-UTF-8 locale but
still run GIMP with a LANG setting that uses characters not present in the
filename encoding? Or would such a situation come under "don't do that then"?
Comment 1 Tor Lillqvist 2005-04-04 07:53:01 UTC
BTW, running with GLib 2.6 doesn't help either, because GIMP then uses the
backward-compatibility version of g_filename_from_utf8() that still tries to
convert to the system codepage.
Comment 2 Sven Neumann 2005-04-04 08:16:35 UTC
It shouldn't be difficult to handle the NULL return value properly. This can
only ever happen for data that should not be saved anyway.
Comment 3 Tor Lillqvist 2005-04-04 08:29:45 UTC
> This can only ever happen for data that should not be saved anyway.

OK, good to know. FWIW, in my case, it happened for the gradient called "FG to
Transparent"
Comment 4 Sven Neumann 2005-04-04 15:18:01 UTC
Fixed in both branches. Also added a warning that should catch similar problems:

2005-04-04  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdata.c (gimp_data_create_filename): return early if
	called for an internal data object. Fixes bug #172581.
Comment 5 Sven Neumann 2005-04-07 20:45:55 UTC
*** Bug 168670 has been marked as a duplicate of this bug. ***