--- mutt-1.5.13/Makefile.am~ Tue Feb 15 20:24:34 2005 +++ mutt-1.5.13/Makefile.am Tue Feb 15 20:25:01 2005 @@ -28,10 +28,10 @@ score.c send.c sendlib.c signal.c sort.c \ status.c system.c thread.c charset.c history.c lib.c \ muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c \ - url.c ascii.c mutt_idna.c crypt-mod.c crypt-mod.h + url.c ascii.c mutt_idna.c crypt-mod.c crypt-mod.h myiconv.c mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \ - $(INTLLIBS) $(LIBICONV) $(LIBGPGME_LIBS) + $(INTLLIBS) $(LIBICONV) $(LIBGPGME_LIBS) -lhz mutt_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAPDEPS) \ $(INTLDEPS) --- mutt-1.5.13/init.h.orig Sun Jul 29 22:44:40 2001 +++ mutt-1.5.13/init.h Sun Jul 29 22:51:23 2001 @@ -242,6 +242,11 @@ ** unset, you must first use the tag-prefix function (default: ";") to ** make the next function apply to all tagged messages. */ + { "bbsislame", DT_BOOL, R_NONE, OPTBBSISLAME, 0 }, + /* + ** .pp + ** When this variable is set, mutt will beep when an error occurs. + */ { "beep", DT_BOOL, R_NONE, OPTBEEP, 1 }, /* ** .pp @@ -1832,7 +1837,7 @@ ** mutt scores are always greater than or equal to zero, the default setting ** of this variable will never mark a message read. */ - { "send_charset", DT_STR, R_NONE, UL &SendCharset, UL "us-ascii:iso-8859-1:utf-8" }, + { "send_charset", DT_STR, R_NONE, UL &SendCharset, UL "big5:gb2312:us-ascii:iso-8859-1:utf-8" }, /* ** .pp ** A list of character sets for outgoing messages. Mutt will use the @@ -2189,7 +2194,7 @@ ** machine without having to enter a password. */ #endif - { "use_8bitmime", DT_BOOL, R_NONE, OPTUSE8BITMIME, 0 }, + { "use_8bitmime", DT_BOOL, R_NONE, OPTUSE8BITMIME, 1 }, /* ** .pp ** \fBWarning:\fP do not set this variable unless you are using a version --- mutt-1.5.13/mutt.h.orig Sun Jul 29 22:58:45 2001 +++ mutt-1.5.13/mutt.h Sun Jul 29 22:48:31 2001 @@ -306,6 +306,7 @@ OPTATTACHSPLIT, OPTAUTOEDIT, OPTAUTOTAG, + OPTBBSISLAME, OPTBEEP, OPTBEEPNEW, OPTBOUNCEDELIVERED, --- mutt-1.5.13/sendlib.c.orig Sun Jul 29 22:53:44 2001 +++ mutt-1.5.13/sendlib.c Sun Jul 29 22:55:59 2001 @@ -2108,7 +2108,7 @@ rfc2047_encode_adrlist (env->mail_followup_to, "Mail-Followup-To"); rfc2047_encode_adrlist (env->reply_to, "Reply-To"); - if (env->subject) + if (env->subject && !option(OPTBBSISLAME)) { rfc2047_encode_string (&env->subject); } --- mutt-1.5.13/parse.c.orig Mon Apr 30 06:00:19 2001 +++ mutt-1.5.13/parse.c Sun Jul 29 22:35:58 2001 @@ -363,7 +363,10 @@ s++; SKIPWS (s); if ((s = mutt_get_parameter ("filename", (parms = parse_parameters (s)))) != 0) - mutt_str_replace (&ct->filename, s); + { + mutt_str_replace (&ct->filename, s); + rfc2047_decode (&ct->filename); + } if ((s = mutt_get_parameter ("name", parms)) != 0) ct->form_name = safe_strdup (s); mutt_free_parameter (&parms); --- mutt-1.5.13/mbyte.c.orig Tue Mar 26 17:49:30 2002 +++ mutt-1.5.13/mbyte.c Fri Aug 30 03:13:52 2002 @@ -20,6 +20,9 @@ * Japanese support by TAKIZAWA Takashi . */ +/* + * Trad. Chinese (Big5) support by yjchou@linux.cis.nctu.edu.tw + */ #include "mutt.h" #include "mbyte.h" #include "charset.h" @@ -35,6 +38,7 @@ int Charset_is_utf8 = 0; #ifndef HAVE_WC_FUNCS static int charset_is_ja = 0; +static int charset_is_big5 = 0; static iconv_t charset_to_utf8 = (iconv_t)(-1); static iconv_t charset_from_utf8 = (iconv_t)(-1); #endif @@ -48,6 +52,7 @@ Charset_is_utf8 = 0; #ifndef HAVE_WC_FUNCS charset_is_ja = 0; + charset_is_big5 = 0; if (charset_to_utf8 != (iconv_t)(-1)) { iconv_close (charset_to_utf8); @@ -70,6 +75,14 @@ charset_from_utf8 = iconv_open (charset, "UTF-8"); } #endif +#ifndef HAVE_WC_FUNCS + else if (!strcmp(buffer, "big5")) + { + charset_is_big5 = 1; + charset_to_utf8 = iconv_open ("UTF-8", charset); + charset_from_utf8 = iconv_open (charset, "UTF-8"); + } +#endif #ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset(PACKAGE, buffer); @@ -244,7 +257,7 @@ int iswprint (wint_t wc) { - if (Charset_is_utf8 || charset_is_ja) + if (Charset_is_utf8 || charset_is_ja || charset_is_big5) return ((0x20 <= wc && wc < 0x7f) || 0xa0 <= wc); else return (0 <= wc && wc < 256) ? IsPrint (wc) : 0; @@ -252,7 +265,7 @@ int iswspace (wint_t wc) { - if (Charset_is_utf8 || charset_is_ja) + if (Charset_is_utf8 || charset_is_ja || charset_is_big5) return (9 <= wc && wc <= 13) || wc == 32; else return (0 <= wc && wc < 256) ? isspace (wc) : 0; @@ -303,7 +316,7 @@ wint_t towupper (wint_t wc) { - if (Charset_is_utf8 || charset_is_ja) + if (Charset_is_utf8 || charset_is_ja || charset_is_big5) return towupper_ucs (wc); else return (0 <= wc && wc < 256) ? toupper (wc) : wc; @@ -311,7 +324,7 @@ wint_t towlower (wint_t wc) { - if (Charset_is_utf8 || charset_is_ja) + if (Charset_is_utf8 || charset_is_ja || charset_is_big5) return towlower_ucs (wc); else return (0 <= wc && wc < 256) ? tolower (wc) : wc; @@ -319,7 +332,7 @@ int iswalnum (wint_t wc) { - if (Charset_is_utf8 || charset_is_ja) + if (Charset_is_utf8 || charset_is_ja || charset_is_big5) return iswalnum_ucs (wc); else return (0 <= wc && wc < 256) ? isalnum (wc) : 0; @@ -344,13 +357,31 @@ return -1; } +int wcwidth_big5(wchar_t ucs) +{ + return wcwidth_ja (ucs); +} + int wcwidth_ucs(wchar_t ucs); int wcwidth (wchar_t wc) { if (!Charset_is_utf8) { - if (!charset_is_ja) + if (charset_is_ja) + { + /* Japanese */ + int k = wcwidth_ja (wc); + if (k != -1) + return k; + } + else if (charset_is_big5) + { + int k = wcwidth_big5 (wc); + if (k != -1) + return k; + } + else { /* 8-bit case */ if (!wc) @@ -359,13 +390,6 @@ return 1; else return -1; - } - else - { - /* Japanese */ - int k = wcwidth_ja (wc); - if (k != -1) - return k; } } return wcwidth_ucs (wc); --- mutt-1.5.13/pager.c.orig Fri Jan 25 05:12:18 2002 +++ mutt-1.5.13/pager.c Fri Aug 30 03:16:55 2002 @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +/* + * Trad. Chinese support by Michael Hsin + */ + #include "mutt.h" #include "mutt_curses.h" #include "mutt_regex.h" @@ -1032,7 +1036,7 @@ { int space = -1; /* index of the last space or TAB */ int col = option (OPTMARKERS) ? (*lineInfo)[n].continuation : 0; - int ch, vch, k, last_special = -1, special = 0, t; + int ch, vch, k, last_special = -1, special = 0, t = 0, old_t = 0; wchar_t wc; mbstate_t mbstate; @@ -1127,7 +1131,10 @@ { if (wc == ' ') space = ch; + old_t = t; t = wcwidth (wc); + if(t > 1 || old_t > 1) + space = ch; if (col + t > wrap_cols) break; col += t; @@ -1344,6 +1351,7 @@ { buf_ptr = buf + ch; /* skip trailing blanks */ + ch --; while (ch && (buf[ch] == ' ' || buf[ch] == '\t' || buf[ch] == '\r')) ch--; cnt = ch + 1; --- mutt-1.5.13/pgp.c.orig Mon Jun 17 00:40:59 2002 +++ mutt-1.5.13/pgp.c Mon Jun 17 00:45:09 2002 @@ -923,7 +923,7 @@ int empty = 1; pid_t thepid; - convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ + if (!option(OPTBBSISLAME)) convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ mutt_mktemp (sigfile); if ((fp = safe_fopen (sigfile, "w")) == NULL) --- mutt-1.5.13/myiconv.c.orig Tue Feb 15 20:26:08 2005 +++ mutt-1.5.13/myiconv.c Tue Feb 15 20:29:59 2005 @@ -0,0 +1,167 @@ +/* + * Contributed by Kuang-che Wu + */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include "mutt.h" +#include "charset.h" +#include +#include + + + +#ifdef HAVE_ICONV + +typedef struct myiconv { + iconv_t cd; + int incode,outcode; + int myjob; +} myiconv_t; + +static int is_init; +static void *dlh; +static iconv_t (*old_iconv_open)(const char *tocode, const char *fromcode); +static size_t (*old_iconv)(iconv_t cd, ICONV_CONST char **inbuf, + size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +static int (*old_iconv_close) (iconv_t cd); +static int inst; + +static void init(void) +{ + hz_setup(); + dlh=dlopen("libiconv.so",RTLD_LAZY); + if(dlh) { + old_iconv_open=dlsym(dlh,"iconv_open"); + old_iconv=dlsym(dlh,"iconv"); + old_iconv_close=dlsym(dlh,"iconv_close"); + } + is_init=1; +} + +static size_t myconv(ICONV_CONST char **inbuf, + size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + /* reference to autogb.c */ + int count; + char buff[MAX_BUFFER*3]; + char *pbuf,*ps; + size_t rt=0; + + pbuf=&buff[2]; + + count=*inbytesleft; + if(count>MAX_BUFFER) count=MAX_BUFFER; + memcpy(pbuf,*inbuf,count); + *inbuf+=count; + *inbytesleft-=count; + while(count>0) { + rt+=count; + ps=hz_convert(pbuf,&count,0); + memcpy(*outbuf,ps,count); + *outbuf+=count; *outbytesleft+=count; + pbuf=&buff[2]; + + count=*inbytesleft; + if(count>MAX_BUFFER) count=MAX_BUFFER; + memcpy(pbuf,*inbuf,count); + *inbuf+=count; + *inbytesleft-=count; + } + return rt; +} + +int conv_str(const char* str_code) +{ + int i; + char *str; + struct mapping { + char *code; + int value; + } map[]={ + {"gb2312",GB_CODE}, + {"euccn",GB_CODE}, + {"big5",BIG5_CODE}, + {0,OTHER_CODE}, /* should we handle below cases? */ + {"hz",HZ_CODE}, + {"uni",UNI_CODE}, + {"utf7",UTF7_CODE}, + {"utf8",UTF8_CODE}, + }; + str=strdup(str_code); + if(strchr(str,'/')) + *strchr(str,'/')=0; + for(i=0;map[i].code;i++) + if(mutt_chscmp(str,map[i].code)) + break; + free(str); + return map[i].value; +} + +iconv_t iconv_open (const char *tocode, const char *fromcode) +{ + myiconv_t *mycd=(myiconv_t*)-1; + iconv_t cd; + char *_tocode, *_fromcode; + + _tocode = tocode; + _fromcode = fromcode; + + if (!mutt_strcmp(tocode,"big5")) _tocode = "big5-hkscs"; + if (!mutt_strcmp(fromcode,"big5")) _fromcode = "big5-hkscs"; + + if(!is_init) init(); + if(!old_iconv_open) + return (iconv_t)(-1); + + if((cd=old_iconv_open(_tocode,_fromcode))!=(iconv_t)-1) { + mycd=(myiconv_t*)calloc(1,sizeof(myiconv_t)); + mycd->cd=cd; + mycd->incode=conv_str(fromcode); + mycd->outcode=conv_str(tocode); + /* inst==0 is because: + libhz only has one stack, and + it will destroy all instance's data when setup stack. + + If want to fix, libhz's init func should know which inst. + */ + if(inst==0 && mycd->incode!=mycd->outcode && + hz_search(mycd->incode,mycd->outcode,8)) { + inst++; + mycd->myjob=1; + } + } + return (iconv_t)mycd; +} + +size_t iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) +{ + myiconv_t *mycd=(myiconv_t*)cd; + size_t rt=(size_t)0; + if(mycd->myjob) { + if(!inbuf || !*inbuf || !outbuf || !*outbuf) + hz_search(mycd->incode,mycd->outcode,8); + else + rt=myconv(inbuf,inbytesleft,outbuf,outbytesleft); + } else if(old_iconv) + rt=old_iconv(mycd->cd,inbuf,inbytesleft,outbuf,outbytesleft); + return rt; +} + +int iconv_close (iconv_t cd) +{ + myiconv_t *mycd=(myiconv_t*)cd; + if(!old_iconv_close) + return 0; + old_iconv_close(mycd->cd); + if(mycd->myjob) + inst--; + free(mycd); + return 0; +} + +#endif --- mutt-1.5.13/po/zh_TW.po~ Fri Aug 12 05:50:38 2005 +++ mutt-1.5.13/po/zh_TW.po Tue Aug 30 11:10:11 2005 @@ -1700,7 +1700,7 @@ "~w 檔案\t\t將訊息寫入檔案\n" "~x\t\t停止修改並離開編輯器\n" "~?\t\t這訊息\n" -".\t\t如果是一行裏的唯一字符,則代表結束輸入\n" +".\t\t如果是一行裡的唯一字符,則代表結束輸入\n" #: edit.c:186 #, c-format @@ -1709,7 +1709,7 @@ #: edit.c:328 msgid "(End message with a . on a line by itself)\n" -msgstr "(在一行裏輸入一個 . 符號來結束信件)\n" +msgstr "(在一行裡輸入一個 . 符號來結束信件)\n" #: edit.c:386 msgid "No mailbox.\n" @@ -2527,7 +2527,7 @@ #: keymap_alldefs.h:43 msgid "rename/move an attached file" -msgstr "更改檔名∕移動 已被附帶的檔案" +msgstr "更改檔名/移動 已被附帶的檔案" #: keymap_alldefs.h:44 msgid "send the message" @@ -2535,7 +2535,7 @@ #: keymap_alldefs.h:45 msgid "toggle disposition between inline/attachment" -msgstr "切換 合拼∕附件式 觀看模式" +msgstr "切換 合拼/附件式 觀看模式" #: keymap_alldefs.h:46 msgid "toggle whether to delete file after sending it" @@ -3137,11 +3137,11 @@ #: keymap_alldefs.h:194 msgid "Select the previous element of the chain" -msgstr "選擇鏈結裏對上一個部份" +msgstr "選擇鏈結裡對上一個部份" #: keymap_alldefs.h:195 msgid "Select the next element of the chain" -msgstr "選擇鏈結裏跟著的一個部份" +msgstr "選擇鏈結裡跟著的一個部份" #: keymap_alldefs.h:196 msgid "send the message through a mixmaster remailer chain"