At Mon, 03 Oct 2005 18:43:36 +0900,
Martin Duerst wrote:
> > At 09:51 05/09/30, Peter C. McCluskey wrote: > > > I think it might be better to make this option controlled by the ~/.hmrc > >rather than by the ./configure. > > Meaning that it would be a run-time option rather than a compile-time > option? I fully agree. Having to recompile to get I18N benefits would > be a pity.
OK. I added 2 new options, i18n and i18n_body (latter is not implemented yet). And I18N is default option on configure.
Attaching diff to previous patch.
Thanks,
-- Daigo Matsubara / W3C Systems Team / mailto:daigo_at_w3.orgReceived on Tue 11 Oct 2005 06:35:10 PM GMT
diff -c ../i18n-20050912/src/printfile.c src/printfile.c *** ../i18n-20050912/src/printfile.c Tue Oct 11 19:41:53 2005
--- src/printfile.c Tue Oct 11 18:28:37 2005
*************** *** 390,397 ****
--- 390,402 ----
{ if (ihtmlheaderfile) #ifdef HAVE_ICONV + if (set_i18n){ printfile(fp, ihtmlheaderfile, label, subject, dir, NULL, NULL, "UTF-8", NULL, NULL, filename); + }else{ + printfile(fp, ihtmlheaderfile, label, subject, dir, NULL, NULL, + NULL, NULL, NULL, filename); + } #else printfile(fp, ihtmlheaderfile, label, subject, dir, NULL, NULL, NULL, NULL, NULL, filename); *************** *** 399,405 ****
--- 404,414 ----
else { /* print the navigation bar to upper levels */ #ifdef HAVE_ICONV + if (set_i18n){ print_main_header(fp, TRUE, label, NULL, NULL, subject, "UTF-8", NULL, NULL); + }else{ + print_main_header(fp, TRUE, label, NULL, NULL, subject, NULL, NULL, NULL); + } #else print_main_header(fp, TRUE, label, NULL, NULL, subject, NULL, NULL, NULL); #endif diff -c ../i18n-20050912/src/setup.c src/setup.c *** ../i18n-20050912/src/setup.c Fri Jun 24 10:00:56 2005
--- src/setup.c Tue Oct 11 18:17:18 2005
*************** *** 28,33 ****
--- 28,35 ----
char *set_txtsuffix; char *set_antispamdomain; + bool set_i18n; + bool set_i18n_body; bool set_overwrite; bool set_inlinehtml; bool set_increment; *************** *** 148,153 ****
--- 150,161 ----
int set_delete_level; struct Config cfg[] = { + {"i18n", &set_i18n, BTRUE, CFG_SWITCH, + "# Enable I18N features, must linked with iconv().\n",FALSE}, + + {"i18n_body", &set_i18n_body, BFALSE, CFG_SWITCH, + "# Translate message body into UTF-8. \"i18n\" must be enabled.\n",FALSE}, + {"antispam_at", &set_antispam_at, ANTISPAM_AT, CFG_STRING, "# replace any _at_ sign with this string, if spam flags enabled.\n", FALSE}, diff -c ../i18n-20050912/src/setup.h src/setup.h *** ../i18n-20050912/src/setup.h Mon Nov 29 11:07:20 2004
--- src/setup.h Tue Oct 11 18:17:28 2005
*************** *** 46,51 ****
--- 46,53 ----
extern char *set_default_top_index; extern char *set_txtsuffix; + extern bool set_i18n; + extern bool set_i18n_body; extern bool set_overwrite; extern bool set_inlinehtml; extern bool set_increment; diff -c ../i18n-20050912/src/string.c src/string.c *** ../i18n-20050912/src/string.c Tue Oct 11 19:41:53 2005
--- src/string.c Tue Oct 11 19:38:08 2005
*************** *** 109,115 **** memset(origconvbuf,0,origlen*7); bufleft=origlen*7; ! if (strcasecmp(fromcharset,tocharset)==0){ /* we don't need to convert string here */ *len=origlen; memcpy(origconvbuf,string,origlen);
--- 109,115 ----
memset(origconvbuf,0,origlen*7); bufleft=origlen*7; ! if (!set_i18n || strcasecmp(fromcharset,tocharset)==0){ /* we don't need to convert string here */ *len=origlen; memcpy(origconvbuf,string,origlen); *************** *** 184,189 ****
--- 184,194 ----
INIT_PUSH(buff); + if (!set_i18n){ + PushString(&buff,instr); + RETURN_PUSH(buff); + } + headofucs=ucs=i18n_convstring(instr, "UTF-8", "UCS-2BE", &len); unsigned int p; *** ../i18n-20050912/configure.in Tue Oct 11 19:41:53 2005
--- configure.in Tue Oct 11 17:51:33 2005
*************** *** 332,344 **** dnl iconv check dnl ! AC_ARG_ENABLE(i18n, [ --enable-i18n Include I18N support], [given_iconv=$enableval]) ! if test "$given_iconv" = "yes"; then AC_CHECK_FUNCS(iconv) AC_CHECK_HEADERS(iconv.h) fi - dnl dnl The FNV hash library used for the nonsequential filenames dnl
--- 332,345 ----
dnl iconv check dnl ! AC_ARG_ENABLE(i18n, [ --disable-i18n Disable I18N support], [given_iconv=$enableval]) ! if test "$given_iconv" = "no"; then ! echo "disabled I18N support." ! else AC_CHECK_FUNCS(iconv) AC_CHECK_HEADERS(iconv.h) fi dnl dnl The FNV hash library used for the nonsequential filenames dnl
This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:13 AM GMT GMT