--- terminal-profile.c.orig	2005-08-20 04:51:06.000000000 +0800
+++ terminal-profile.c	2005-12-27 18:09:00.650535000 +0800
@@ -1253,10 +1253,19 @@
   key = gconf_concat_dir_and_key (profile->priv->profile_dir,
                                   KEY_BACKGROUND_IMAGE);
   
-  gconf_client_set_string (profile->priv->conf,
+  if ((filename == NULL) || (g_utf8_validate (filename, -1, NULL))) {
+     gconf_client_set_string (profile->priv->conf,
                            key,
                            filename,
                            NULL);
+  } else {
+     char *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL);
+     gconf_client_set_string (profile->priv->conf,
+                           key,
+                           utf8_filename,
+                           NULL);
+     g_free (utf8_filename);
+  }
 
   g_free (key);
 }
@@ -1799,7 +1808,21 @@
   if (candidate_file != NULL)
     {
       g_free (profile->priv->background_image_file);
-      profile->priv->background_image_file = g_strdup (candidate_file);
+      
+      /*
+       * candidate_file is always utf8, cause it come from gconf database.
+       * we need convert it to locale encoding.
+       * But need check whether utf8 file exist, if yes, then don't need
+       * convert (gtk_file_chooser_get_filename can display both utf8 and 
+       * non-utf8 filename on non-utf8 locale)
+       */
+      if (g_file_test (candidate_file, G_FILE_TEST_EXISTS))
+      	profile->priv->background_image_file = g_strdup (candidate_file);
+      else {
+	char *sys_file = g_locale_from_utf8 (candidate_file, -1, NULL, NULL, NULL);
+	profile->priv->background_image_file = g_strdup (sys_file);
+	g_free (sys_file);
+      }
 
       if (profile->priv->background_image != NULL)
         {
