GNOME Bugzilla – Bug 99247
pan doesn't remember default Content-type: charset
Last modified: 2004-12-22 21:47:04 UTC
If you choose in "compose"->"more headers"->codepage option menu your favorite codepage (iso8859-2 for me), it will be back to iso8859-15 when you compose another mail. adding option menu in preferences or saving last state from compose window can solve problem. i'm using 1.3.2.90 compiled from source
The default charset is set on a per-group basis: look in the group's properties (right-click on the group). Not closing just yet, because there are reasons for decoupling the posting charset from the group's default charset (used also to parse incoming articles). Then again, there are reasons for not having a global default posting charset (e.g. users posting in different groups with different charsets). Charles: thoughts?
Ha, that's the problem. So, what about changing the bug to: "how say to newbie, that you can set per group default charset?" and possible fix: Allow to show group options, when you are subscribing new group, than newbie is introduced to this possibility (Probably global option "Set group options on subscribe Yes/No/Ask" is needed too). I made some changes to group_action_selected_subscribe() which implement this (based on my functions). I can make change based on regular Pan functions (with little help), if someone other is interested too, otherwise feel free to set this bug to NOTABUG :) #include <string.h> [--snip--] /* this 3 functions are only for "Do you want it?" dialog, so change it to Pan default "message_box" */ static gint message_box(gchar * message, GtkMessageType type, GtkButtonsType buttons) { GtkWidget *dialog; gint result; gchar *s; g_assert(message != NULL); result = GTK_RESPONSE_NONE; if (message != NULL) { s = g_locale_to_utf8(message,strlen(message), NULL, NULL, NULL); if (s != NULL) { dialog = gtk_message_dialog_new(GTK_WINDOW(Pan.window), GTK_DIALOG_DESTROY_WITH_PARENT, type, buttons, s); result = gtk_dialog_run(GTK_DIALOG(dialog)); g_free(s); gtk_widget_destroy(dialog); } else { } } else { } return result; } static gint question_box(gchar * message) { return message_box(message, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO); } static gboolean mbox_result_to_bool(gint result) { gboolean ret; switch (result) { case GTK_RESPONSE_ACCEPT: case GTK_RESPONSE_YES: case GTK_RESPONSE_OK: case GTK_RESPONSE_APPLY: ret = TRUE; break; default: ret = FALSE; break; } return ret; } /* here is the change - allow to set charset on group subscribe */ void group_action_selected_subscribe (void) { guint i; GPtrArray * a; debug_enter ("group_action_selected_subscribe"); a = get_selected_groups (); if (a->len) groups_set_subscribed ((Group**)a->pdata, a->len, TRUE); /* allow to choose, if user wants to set options */ if(mbox_result_to_bool(question_box("Set group(s) options too?"))){ for (i=0; i<a->len; ++i) dialog_group_props (GTK_WINDOW(Pan.window), GROUP(g_ptr_array_index(a,i))); } g_ptr_array_free (a, TRUE); debug_exit ("group_action_selected_subscribe"); }
I agree that there needs to be a more obvious way to direct users to set a group's default charset, but I don't know what that might be. I don't think that adding a dialog when subscribing is the answer, because users can always post to groups they're not subscribed to. Perhaps the group's default charset could be set with the new post's charset when a user posts?
The problem is that the group's charset has three different functions: 1. For the thread pane, it's used to convert 8bit headers to UTF-8 2. For the article pane, it's used to convert the body to UTF-8 when the article does not provide a charset header 3. For posting, it's used as the default charset So, if we change the group's charset when the user posts, we can break 1 and 2. Perhaps it would be best to decouple the group's charset from posting and have a 'default charset for posting' in the preferences? This is what both Evolution and Mozilla do. Thoughts?
Chris: sounds good.
Fixed in CVS: http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=identity.c&rev1=1.12&rev2=1.13&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=identity-xml.c&rev1=1.21&rev2=1.22&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=identity-manager.h&rev1=1.8&rev2=1.9&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=identity-manager.c&rev1=1.19&rev2=1.20&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=identity-edit-ui.c&rev1=1.27&rev2=1.28&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=pan-charset-picker.h&rev1=1.4&rev2=1.5&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=pan-charset-picker.c&rev1=1.8&rev2=1.9&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=message-window.c&rev1=1.352&rev2=1.353&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan&command=DIFF_FRAMESET&file=ChangeLog&rev1=1.1747&rev2=1.1748&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=identity.h&rev1=1.4&rev2=1.5&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/identities&command=DIFF_FRAMESET&file=profiles.dtd&rev1=1.1&rev2=1.2&root=/cvs/gnome