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 168604 - [Patch] Background Properties does not support non-UTF-8 filenames
[Patch] Background Properties does not support non-UTF-8 filenames
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
git master
Other All
: High critical
: ---
Assigned To: Rodney Dawes
Control-Center Maintainers
: 146130 146645 171589 172235 172240 301400 304987 308895 311851 312982 314078 317086 318414 318691 319452 321111 334909 342559 355412 466196 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-26 18:59 UTC by Rodney Dawes
Modified: 2007-08-13 14:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Againt cvs HEAD. Gzipped tarball. (1.65 KB, application/x-compressed-tar)
2005-04-26 23:37 UTC, kz
  Details
patches for gnome-wp-capplet.c, gnome-wp-item.c and gnome-wp-xml.c (8.06 KB, patch)
2005-05-22 19:26 UTC, Takao Fujiwara
none Details | Review
Obsolete 46759. (7.83 KB, patch)
2005-05-22 19:41 UTC, Takao Fujiwara
none Details | Review
Patch for gnome-wp-capplet.c, gnome-wp-item.c, gnome-wp-xml.c and preferences.c (7.94 KB, patch)
2005-08-27 04:26 UTC, Takao Fujiwara
rejected Details | Review
Patch to the capplet portion of the background setting code (6.55 KB, patch)
2005-09-20 00:36 UTC, Rodney Dawes
committed Details | Review
Patch for libbackground portion of code (1.82 KB, patch)
2005-09-20 00:37 UTC, Rodney Dawes
committed Details | Review

Description Rodney Dawes 2005-02-26 18:59:42 UTC
Please describe the problem:
Filenames which are not encoded in the UTF-8 character set are not handled
appropriately in the gnome background settings. There were a number of
duplicates to a couple crashers which I am resolving as duplicates of this bug
now. The code which is about to be committed to CVS (as soon as this bug is
filed for reference) no longer crashes. It will simply ignore non-UTF-8 encoded
filenames for the time
being. This is a quick fix to solve the crashing problem. Ignoring the files, is
much better than crashing or corrupting the XML and aborting on next run.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Rodney Dawes 2005-02-26 19:01:51 UTC
*** Bug 146645 has been marked as a duplicate of this bug. ***
Comment 2 Rodney Dawes 2005-02-26 19:02:31 UTC
*** Bug 146130 has been marked as a duplicate of this bug. ***
Comment 3 Rodney Dawes 2005-03-25 16:42:57 UTC
*** Bug 171589 has been marked as a duplicate of this bug. ***
Comment 4 sdiconov 2005-03-25 17:38:13 UTC
It should be converted from current locale into UTF-8 (man iconv). The current
"fix" fixes nothing. In fact, it breaks background setting and can be a
showstopper for photo-amateurs. 
Comment 5 Rodney Dawes 2005-03-25 18:17:28 UTC
The fix fixes the crash. It doesn't break anything. You can't break something
that never worked in the first place. If you convert the filenames into UTF-8 on
the filesystem, then it will work fine. I will look at the problem further when
I have the time to do so. The patch that was proposed in one of the other bugs,
does not fix the problem, and causes other crashes. Due to time constraints, and
the number of crash occurances, I was forced to fix the crash by just ignoring
invalid UTF-8 filenames.
Comment 6 sdiconov 2005-03-25 19:31:33 UTC
My family hopes that it happens before next release :) 
Comment 7 Eungkyu Song 2005-04-07 17:52:39 UTC
How can I manually remove saved background setting information?

After I added png of non-utf-8 filename to background, I can't use
gnome-background-properties because it always crashes.

Comment 8 Elijah Newren 2005-04-21 15:25:48 UTC
*** Bug 301400 has been marked as a duplicate of this bug. ***
Comment 9 Rodney Dawes 2005-04-25 15:20:36 UTC
*** Bug 172235 has been marked as a duplicate of this bug. ***
Comment 10 kz 2005-04-26 23:37:45 UTC
Created attachment 45718 [details]
Againt cvs HEAD. Gzipped tarball.

Patch background capplet of gnome-control-center, and nautilus.

Known problem; you can add an item many times. FIXME.
Comment 11 Rodney Dawes 2005-04-27 16:32:18 UTC
These patches also have several memory leaks in them.
Comment 12 Christian Kirbach 2005-05-21 12:22:56 UTC
Bug 146130 has a large number of duplicates....
Comment 13 Christian Kirbach 2005-05-21 12:23:41 UTC
*** Bug 304987 has been marked as a duplicate of this bug. ***
Comment 14 Takao Fujiwara 2005-05-22 19:26:19 UTC
Created attachment 46759 [details] [review]
patches for gnome-wp-capplet.c, gnome-wp-item.c and gnome-wp-xml.c

Revised patch 45718. I fixed memory reak and some minor problems.
Could somebody change the patch for HEAD?
I don't have the HEAD environment.
Comment 15 Takao Fujiwara 2005-05-22 19:29:18 UTC
I also filed bug 172240 for nautilus.
Comment 16 Takao Fujiwara 2005-05-22 19:41:06 UTC
Created attachment 46760 [details] [review]
Obsolete 46759.
Comment 17 Sebastien Bacher 2005-06-24 14:30:28 UTC
*** Bug 308895 has been marked as a duplicate of this bug. ***
Comment 18 Rodney Dawes 2005-07-10 20:06:10 UTC
Takao: Can you at least make the patch against 2.10 or something? 2.6 is
ridiculously old.
Comment 19 Teppo Turtiainen 2005-07-28 18:40:18 UTC
*** Bug 311851 has been marked as a duplicate of this bug. ***
Comment 20 Teppo Turtiainen 2005-08-09 20:29:42 UTC
*** Bug 312982 has been marked as a duplicate of this bug. ***
Comment 21 Sebastien Bacher 2005-08-21 12:54:43 UTC
*** Bug 314078 has been marked as a duplicate of this bug. ***
Comment 22 Takao Fujiwara 2005-08-27 04:26:39 UTC
Created attachment 51402 [details] [review]
Patch for gnome-wp-capplet.c, gnome-wp-item.c, gnome-wp-xml.c and preferences.c

Created the patch for GNOME 2.11.
Comment 23 Takao Fujiwara 2005-08-27 04:29:36 UTC
I'm sorry for the late response. Now I got time to setup GNOME 2.11.
I checked the patch on Linux only and probably I'll need a test for Solaris.
However at the moment, this patch works fine.
Comment 24 kz 2005-09-08 04:58:53 UTC
Is this pending?
Anybody has a good solution? or I want make this patch commited into cvs repository.
Comment 25 Rodney Dawes 2005-09-08 11:44:02 UTC
I wasn't aware of an updated patch. I'll review it soon.
Comment 26 Rodney Dawes 2005-09-18 21:52:48 UTC
Hrmm. It looks like there are unrelated changes in the patch for the background
capplet part. The libbackground part still needs some work I think, to support
filenames encoded in utf8, when using G_BROKEN_FILENAMES and a non-utf8/ascii
locale. I've made those changes, and will test them soon.

However, in the capplet-specific code, you seem to have some changes at least in
the dragged image callback code that are not related to charset encoding at all.
This is just a first glance though, and I haven't seen all of the changes yet,
so there may still be more.
Comment 27 Rodney Dawes 2005-09-19 22:45:47 UTC
What are the following changes for? Why are they here? They have nothing to do
with the charset issue.

@@ -168,6 +165,7 @@ static void bg_properties_dragged_image 
     uris = gnome_vfs_uri_list_parse ((gchar *) selection_data->data);
 
     if (uris != NULL && uris->data != NULL) {
+      GList * uris_orig = uris;
       GdkCursor * cursor;
 
       cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
@@ -176,9 +174,10 @@ static void bg_properties_dragged_image 
       gdk_cursor_unref (cursor);
 
       for (; uris != NULL; uris = uris->next) {
-	realuris = g_slist_append (realuris,
-				   g_strdup (gnome_vfs_uri_get_path (uris->data)));
+        gchar *filename_uri = gnome_vfs_unescape_string_for_display
(gnome_vfs_uri_get_path (uris->data));
+	realuris = g_slist_append (realuris, filename_uri);
       }
+      uris = uris_orig;
       gnome_wp_add_images (capplet, realuris);
       gdk_window_set_cursor (capplet->window->window, NULL);
     }
Comment 28 Rodney Dawes 2005-09-20 00:36:53 UTC
Created attachment 52413 [details] [review]
Patch to the capplet portion of the background setting code
Comment 29 Rodney Dawes 2005-09-20 00:37:42 UTC
Created attachment 52414 [details] [review]
Patch for libbackground portion of code
Comment 30 Rodney Dawes 2005-09-20 00:40:32 UTC
These two new patches are what I will commit assuming that they get enough
testing. Please test them with various charsets. They seem to work for me in
ISO8859-1 and UTF-8. They also allow UTF-8 while in other charsets as well. So
please test that both UTF-8 and your charset work while logged in with a
non-UTF8 charset and proper environment settings.
Comment 31 Rodney Dawes 2005-09-20 00:43:52 UTC
*** Bug 172240 has been marked as a duplicate of this bug. ***
Comment 32 Sebastien Bacher 2005-09-25 21:34:03 UTC
*** Bug 317086 has been marked as a duplicate of this bug. ***
Comment 33 Takao Fujiwara 2005-09-27 10:54:08 UTC
I don't mind to use UTF-8 or URI.
I checked the latest patch and it's ok.

Just reply:
> What are the following changes for? Why are they here? They have nothing to do
> with the charset issue.
> +      GList * uris_orig = uris;
[...]
> +      uris = uris_orig;

It's not this bug. I noticed the uris is freed later but the uris is incremented
in the for() statement so I just reverted uris but it's not so critical.
Comment 34 Rodney Dawes 2005-10-01 21:30:48 UTC
OK. I've committed my two patches to CVS now. They should be in the 2.12.1 release.
Comment 35 Sebastien Bacher 2005-10-22 10:35:27 UTC
*** Bug 319452 has been marked as a duplicate of this bug. ***
Comment 36 Sebastien Bacher 2005-11-13 12:06:24 UTC
*** Bug 321111 has been marked as a duplicate of this bug. ***
Comment 37 Teppo Turtiainen 2005-12-25 19:29:13 UTC
*** Bug 318414 has been marked as a duplicate of this bug. ***
Comment 38 Teppo Turtiainen 2005-12-25 19:33:42 UTC
*** Bug 318691 has been marked as a duplicate of this bug. ***
Comment 39 Karsten Bräckelmann 2006-03-17 17:01:41 UTC
*** Bug 334909 has been marked as a duplicate of this bug. ***
Comment 40 Karsten Bräckelmann 2006-07-22 00:04:16 UTC
*** Bug 342559 has been marked as a duplicate of this bug. ***
Comment 41 Fabio Bonelli 2006-09-12 08:10:22 UTC
*** Bug 355412 has been marked as a duplicate of this bug. ***
Comment 42 palfrey 2007-08-13 14:38:17 UTC
*** Bug 466196 has been marked as a duplicate of this bug. ***