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 323853 - evolution cannot import task files with none UTF-8 filenames.
evolution cannot import task files with none UTF-8 filenames.
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Shell
2.6.x
Other Solaris
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2005-12-12 09:47 UTC by Xiurong Simon Zheng
Modified: 2013-09-13 01:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.89 KB, patch)
2005-12-12 10:18 UTC, Xiurong Simon Zheng
none Details | Review
patch (1.46 KB, patch)
2005-12-27 12:34 UTC, Xiurong Simon Zheng
none Details | Review
fix the bug 323853 (3.48 KB, patch)
2006-01-25 06:57 UTC, Cai Nan
none Details | Review
replace GnomeFileEntry by GtkFileChooserButton in mail pref (6.00 KB, patch)
2006-02-08 11:07 UTC, Cai Nan
none Details | Review
replace GnomeFileEntry by GtkFileChooserButton in mail pref (6.07 KB, patch)
2006-02-08 11:39 UTC, Cai Nan
none Details | Review
replace GnomeFileEntry by GtkFileChooserButton in composer pref & mail pref (10.52 KB, patch)
2006-02-08 13:42 UTC, Cai Nan
none Details | Review
replace GnomeFileEntry by GtkFileChooserButton in file filter (2.75 KB, patch)
2006-02-08 14:55 UTC, Cai Nan
none Details | Review
replace GnomeFileEntry and GnomePixmapEntry by GtkFileChooserButton, In gtkhtml/components/html-editor/cell.c, image.c, table.c, cell.c (21.41 KB, patch)
2006-02-21 10:10 UTC, ShiPu
reviewed Details | Review
[New] replace GnomeFileEntry by GtkFileChooserButton in composer pref & mail pref (11.00 KB, patch)
2006-02-28 06:51 UTC, ShiPu
none Details | Review
[New] replace GnomeFileEntry by GtkFileChooserButton in file filter (3.05 KB, patch)
2006-02-28 06:54 UTC, ShiPu
none Details | Review
Replace GnomeFileEntry by GtkFileChooserButton in Plugins/save-attachment (2.94 KB, patch)
2006-02-28 10:17 UTC, ShiPu
none Details | Review
[Corrected]replace GnomeFileEntry and GnomePixmapEntry by GtkFileChooserButton, In gtkhtml/components/html-editor/cell.c, image.c, table.c, cell.c (20.19 KB, patch)
2006-03-03 08:54 UTC, ShiPu
committed Details | Review
[Corrected]replace GnomeFileEntry by GtkFileChooserButton in file filter (3.12 KB, patch)
2006-03-03 08:55 UTC, ShiPu
committed Details | Review
[Corrected]replace GnomeFileEntry by GtkFileChooserButton in composer pref & mail pref (12.25 KB, patch)
2006-03-03 08:56 UTC, ShiPu
committed Details | Review
[Corrected]Replace GnomeFileEntry by GtkFileChooserButton in Plugins/save-attachment (2.93 KB, patch)
2006-03-03 08:57 UTC, ShiPu
committed Details | Review
[Corrected]Replace GnomeFileEntry by GtkFileChooserButton in shell/e-shell-importer.c (3.76 KB, patch)
2006-03-03 08:58 UTC, ShiPu
committed Details | Review

Description Xiurong Simon Zheng 2005-12-12 09:47:42 UTC
Version details: trunk 2.4

1. Invoke evolution on none UTF8 locale.(eg. zh_CN.gb18030. On Linux, please set
"G_FILENAME_ENCODING = gb18030")
2. Choose [File] -> [New] -> [Task] and launch [Task - No summary] dialog
3. Input task information in the dialog, click [Save] button and close the 
dialog.
4. Select [Local Folders] -> [Tasks] in Folder pane.
5. Right click on the saved task, choose [Save as...] and launch [Save as...] 
dialog.
6. Input Chinese filename and save the task as the file.
7. Choose [File] -> [Import] and launch [Import Assistant] dialog.
8. Choose [Forward], Select [Import a single file], Choose [Forward], Input 
the saved task file, Choose [Automatic] file type, Choose [Forward], Choose [
Import] button.

Then cannot import the localized task name in non-utf8 encoding.
Comment 1 Xiurong Simon Zheng 2005-12-12 10:18:17 UTC
Created attachment 55883 [details] [review]
Patch

The filename got from gtk_entry_get_text() is always in UTF-8 encoding. In
order to operate this file, we need to convert the filename to its original
on-disk encoding. Therefore, apart from filenames whose on-disk encoding are
UTF-8, other filenames should be converted to the Glib encoding.
Comment 2 André Klapper 2005-12-14 22:54:35 UTC
confirming and targetting.
should go both into 2.4.x and HEAD.
Comment 3 Xiurong Simon Zheng 2005-12-27 12:34:04 UTC
Created attachment 56434 [details] [review]
patch

As gnome_file_entry_get_full_path() has supported non-utf8 encoding name(pls see #321144), use gnome_file_entry_get_full_path() instead of gtk_entry_get_text().
Comment 4 Tor Lillqvist 2005-12-28 08:09:16 UTC
Surely there must be lots of other places in Evolution and E-D-S where there there is confusion between UTF-8 and the GLib (on-disk) file name encoding? Presumably most Linux installations use UTF-8 filenames, which is why this hasn't caused more problems.
Comment 5 Xiurong Simon Zheng 2005-12-28 10:27:20 UTC
Tor, just as you said. On Linux and Windows Glib encoding is usually UTF-8, even locale is non-utf8. But on solaris Glib encoding is usually the same as locale, so the non-utf8 encoding filenames are met easily. Do you agree to commit this patch?
Comment 6 Tor Lillqvist 2005-12-28 10:35:41 UTC
Sure, I don't object committing this patch. I was just pondering out loud whether there aren't dozens of other places in Evo that need similar attention, and adding g_filename_to/from_utf8() calls.
Comment 7 Harish Krishnaswamy 2005-12-31 15:21:54 UTC
I agree with Tor - there are other places where there this latent assumption exists. However, gnome_file_entry_get_full_path() is a deprecated call. I wonder if there is a better substitute - though I do not have one to suggest atm.
Comment 8 Xiurong Simon Zheng 2006-01-05 07:03:56 UTC
I'll try to extend to all the code regarding GnomeFileEntry and GnomePixmapEntry. 

As for substitute, the widget GnomeFileEntry is actually deprecated. Instead, GtkFileChooserButton is being using since GTK 2.6+. If we done this, many change will be made. I'm not sure if it's suitable. What about your idea?
Comment 9 André Klapper 2006-01-11 10:24:00 UTC
>grep -r 'gnome_file_entry_get_full_path' ~/gnome-cvs/evolution/*
mail/em-composer-prefs.c
plugins/save-attachments/save-attachments.c

not that much. :-)
Comment 10 Cai Nan 2006-01-25 06:57:27 UTC
Created attachment 58062 [details] [review]
fix the bug 323853

Harish, I have replaced GnomeFileEntry by GtkFileChooserButton, which can import task files with none UTF-8 filenames. But there are some shortcomings:
1. we can't input the file name but select the existing file;
2. the button can't show the full path of the selected file.
Comment 11 Xiurong Simon Zheng 2006-01-25 07:11:56 UTC
As GnomeFileEntry and GnomePixmapEntry are deprecated, there're the following codes that need to be changed too.

evolution/mail/em-mailer-prefs.c
evolution/mail/em-composer-prefs.c
evolution/filter/filter-file.c
evolution/plugins/save-attachments/save-attachments.c
gtkhtml-3.9.4/components/html-editor/image.c
gtkhtml-3.9.4/components/html-editor/body.c
gtkhtml-3.9.4/components/html-editor/cell.c
gtkhtml-3.9.4/components/html-editor/table.c

Comment 12 Harish Krishnaswamy 2006-01-27 07:41:19 UTC
The approach looks fine. can you extend the patch to other files (as discussed in IRC) - so the change can be absorbed in one shot ?
Comment 13 Harry Lu 2006-01-27 08:57:25 UTC
Harish, as you know, we will take the spring festival vacation. So we don't have time to make all those changes before the UI freeze day. 

So we will have to make the changes for Evolution 2.7/2.8.
Comment 14 Harish Krishnaswamy 2006-01-30 06:42:16 UTC
Re-targeting this for GNOME Beta2  (2.13.91)
Comment 15 Cai Nan 2006-02-08 11:07:42 UTC
Created attachment 58913 [details] [review]
replace GnomeFileEntry by GtkFileChooserButton in mail pref
Comment 16 Cai Nan 2006-02-08 11:39:11 UTC
Created attachment 58919 [details] [review]
replace GnomeFileEntry by GtkFileChooserButton in mail pref
Comment 17 Cai Nan 2006-02-08 13:42:07 UTC
Created attachment 58931 [details] [review]
replace GnomeFileEntry by GtkFileChooserButton in composer pref & mail pref
Comment 18 Cai Nan 2006-02-08 14:55:48 UTC
Created attachment 58935 [details] [review]
replace GnomeFileEntry by GtkFileChooserButton in file filter
Comment 19 Xiurong Simon Zheng 2006-02-09 07:44:44 UTC
Harish, yesterday Nancy fell down on her way home after overtime work and was hurt seriously. She might be break for two weeks. Could you possibly review three current patches and check in firstly?
Comment 20 ShiPu 2006-02-21 10:10:27 UTC
Created attachment 59832 [details] [review]
replace GnomeFileEntry and GnomePixmapEntry by GtkFileChooserButton, In gtkhtml/components/html-editor/cell.c, image.c, table.c, cell.c
Comment 21 Xiurong Simon Zheng 2006-02-22 08:28:08 UTC
Harish, shipu complete the remaining patches. Could you please review all the patches?
Comment 22 Srinivasa Ragavan 2006-02-22 16:44:23 UTC
I reviewed it It looks fine. still I need to apply and test. Ill confirm tomorrow.


Just one issue below
-		GtkWidget *entry;
+		GtkEntry *entry;
+		GtkFileChooserButton *button;
 		
-		entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script");
-		gnome_file_entry_set_filename ((GnomeFileEntry *) entry, sig->filename);
+		button = glade_xml_get_widget (prefs->sig_script_gui, "filechooserbutton_add_script");
+		gtk_file_chooser_set_filename ((GtkFileChooser *) button, sig->filename);
 		
 		entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
 		gtk_entry_set_text (GTK_ENTRY (entry), sig->name);



This for sure will emit a warning. Just preserve GtkWidget and dont put GtkEntry
There are 2-3 similiar occurances. Just fix them. Ill test the rest tomorrow and confirm. Thanks.
Comment 23 Xiurong Simon Zheng 2006-02-23 02:39:00 UTC
Srinivasa, thanks for your suggestion. We'll modify it before checking.
Comment 24 ShiPu 2006-02-28 06:46:08 UTC
Srinivasa, i have modified as ur suggestion. And i shall ask simon to obselete elder ones.
Comment 25 ShiPu 2006-02-28 06:51:55 UTC
Created attachment 60286 [details] [review]
[New] replace GnomeFileEntry by GtkFileChooserButton in composer pref & mail pref
Comment 26 ShiPu 2006-02-28 06:54:32 UTC
Created attachment 60287 [details] [review]
[New] replace GnomeFileEntry by GtkFileChooserButton in file filter

Does anybody could obsolete elder ones? i have no right to do it.
Comment 27 ShiPu 2006-02-28 07:27:19 UTC
the elder ones are: id #56434, #58931 and #58935
Comment 28 ShiPu 2006-02-28 10:17:57 UTC
Created attachment 60303 [details] [review]
Replace GnomeFileEntry by GtkFileChooserButton in Plugins/save-attachment
Comment 29 ShiPu 2006-03-03 08:54:05 UTC
Created attachment 60536 [details] [review]
[Corrected]replace GnomeFileEntry and GnomePixmapEntry by GtkFileChooserButton, In gtkhtml/components/html-editor/cell.c, image.c, table.c, cell.c
Comment 30 ShiPu 2006-03-03 08:55:08 UTC
Created attachment 60537 [details] [review]
[Corrected]replace GnomeFileEntry by GtkFileChooserButton in file filter
Comment 31 ShiPu 2006-03-03 08:56:03 UTC
Created attachment 60538 [details] [review]
[Corrected]replace GnomeFileEntry by GtkFileChooserButton in composer pref & mail pref
Comment 32 ShiPu 2006-03-03 08:57:11 UTC
Created attachment 60539 [details] [review]
[Corrected]Replace GnomeFileEntry by GtkFileChooserButton in Plugins/save-attachment
Comment 33 ShiPu 2006-03-03 08:58:43 UTC
Created attachment 60540 [details] [review]
[Corrected]Replace GnomeFileEntry by GtkFileChooserButton in shell/e-shell-importer.c
Comment 34 Harry Lu 2006-04-26 11:05:00 UTC
srag, just a reminder. Please approve these patches for HEAD. Thanks!
Comment 35 Srinivasa Ragavan 2006-04-29 14:56:14 UTC
Looks fine to commit to HEAD.
Comment 36 Irene Huang 2006-04-30 03:26:09 UTC
patch committed to head, please close the bug