Is anyone actively using these? I don't use them myself, which means I'm not very qualified to criticise, but it does seem broken.
When Mutt is deciding what charset to use for a message you are sending, it calls mutt_iconv_open with M_ICONV_HOOK_FROM. When it then really sends the message, it calls fgetconv_open with M_ICONV_HOOK_TO. This is obviously wrong and causes bad behaviour in the following case: charset=utf-8 send_charset=us-ascii:iso-8859-1:utf-8 charset-hook utf-8 utf-8 charset-hook . gb2312 The aim of these settings is to treat all messages as being in GB2312 unless they are labelled as UTF-8. This is the sort of thing someone who receives a lot of broken Chinese e-mails might want to do, with the significant difference that such a person is probably using a GB2312 terminal instead of a UTF-8 one like me. With these settings, when I send a message containing a '£', Mutt correctly chooses iso-8859-1, but then misconverts "£" to "??". Stupid. Now, I don't really understand why charset-hooks are being used AT ALL for sending messages, now that iconv-hook is available, so I am suggesting the attached patch, hoping that people who use charset-hook can tell me if it makes sense. Note that this patch makes M_ICONV_HOOK_TO obsolete. If the patch is correct, further tidying up should be done. Edmund
--- mutt.orig/sendlib.c Sat Apr 20 20:40:39 2002 +++ mutt/sendlib.c Fri May 31 09:47:50 2002 @@ -496,7 +496,7 @@ if (a->type == TYPETEXT && (!a->noconv)) fc = fgetconv_open (fpin, Charset, mutt_get_body_charset (send_charset, sizeof (send_charset), a), - M_ICONV_HOOK_TO); + 0/*M_ICONV_HOOK_none*/); else fc = fgetconv_open (fpin, 0, 0, 0); @@ -682,7 +682,7 @@ CONTENT_STATE *states; size_t *score; - cd1 = mutt_iconv_open ("UTF-8", fromcode, M_ICONV_HOOK_FROM); + cd1 = mutt_iconv_open ("UTF-8", fromcode, 0/*M_ICONV_HOOK_none*/); if (cd1 == (iconv_t)(-1)) return -1;