[cvs] bogofilter/src maint.c,1.60,1.61
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: David R. <re...@us...> - 2005-06-24 11:23:08
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32335/src Modified Files: maint.c Log Message: Use global constants when converting to/from unicode. Index: maint.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/maint.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- maint.c 18 Jun 2005 17:10:48 -0000 1.60 +++ maint.c 24 Jun 2005 11:23:00 -0000 1.61 @@ -18,6 +18,7 @@ #include "buff.h" #include "datastore.h" #include "error.h" +#include "charset.h" #include "convert_unicode.h" #include "iconvert.h" #include "maint.h" @@ -33,8 +34,11 @@ bool timestamp_tokens = true; bool upgrade_wordlist_version = false; +#ifndef DISABLE_UNICODE e_enc old_encoding; e_enc new_encoding; +#define DEFAULT_OR_UNICODE(enc) (enc == E_RAW) ? charset_default : charset_unicode +#endif /* Function Prototypes */ @@ -284,8 +288,8 @@ old_encoding = val.spamcount; new_encoding = encoding; if (old_encoding != new_encoding) { - const char *from_charset = (old_encoding == E_RAW) ? "iso-8859-1" : "utf-8"; - const char *to_charset = (new_encoding == E_RAW) ? "iso-8859-1" : "utf-8"; + const char *from_charset = DEFAULT_OR_UNICODE(old_encoding); + const char *to_charset = DEFAULT_OR_UNICODE(new_encoding); init_charset_table_iconv(from_charset, to_charset); } #endif |