From 01109639c07dc4babec7912a8febfe1f989b1b0d Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 13 Jan 2005 09:30:55 +0000 Subject: removed support for systems which don't support iconv. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@6 ee746299-78ed-0310-b773-934348b2243d --- src/codeconv.c | 35 ----------------------------------- src/codeconv.h | 2 -- src/imap.c | 38 -------------------------------------- src/mainwindow.c | 8 -------- src/messageview.c | 8 -------- src/prefs_common.c | 6 ------ 6 files changed, 97 deletions(-) diff --git a/src/codeconv.c b/src/codeconv.c index 7c5b449b..2ebbbee3 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -375,7 +375,6 @@ void conv_sjistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf) void conv_jistoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) { -#if HAVE_ICONV gchar *tmpstr; tmpstr = conv_iconv_strdup(inbuf, CS_ISO_2022_JP, CS_UTF_8); @@ -384,14 +383,10 @@ void conv_jistoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) g_free(tmpstr); } else strncpy2(outbuf, inbuf, outlen); -#else - strncpy2(outbuf, inbuf, outlen); -#endif /* HAVE_ICONV */ } void conv_sjistoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) { -#if HAVE_ICONV gchar *tmpstr; tmpstr = conv_iconv_strdup(inbuf, CS_SHIFT_JIS, CS_UTF_8); @@ -400,14 +395,10 @@ void conv_sjistoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) g_free(tmpstr); } else strncpy2(outbuf, inbuf, outlen); -#else - strncpy2(outbuf, inbuf, outlen); -#endif /* HAVE_ICONV */ } void conv_euctoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) { -#if HAVE_ICONV gchar *tmpstr; tmpstr = conv_iconv_strdup(inbuf, CS_EUC_JP, CS_UTF_8); @@ -416,9 +407,6 @@ void conv_euctoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) g_free(tmpstr); } else strncpy2(outbuf, inbuf, outlen); -#else - strncpy2(outbuf, inbuf, outlen); -#endif /* HAVE_ICONV */ } void conv_anytoeuc(gchar *outbuf, gint outlen, const gchar *inbuf) @@ -788,7 +776,6 @@ void conv_latintodisp(gchar *outbuf, gint outlen, const gchar *inbuf) void conv_localetodisp(gchar *outbuf, gint outlen, const gchar *inbuf) { -#if HAVE_ICONV gchar *tmpstr; tmpstr = conv_iconv_strdup(inbuf, conv_get_locale_charset_str(), @@ -798,9 +785,6 @@ void conv_localetodisp(gchar *outbuf, gint outlen, const gchar *inbuf) g_free(tmpstr); } else strncpy2(outbuf, inbuf, outlen); -#else - strncpy2(outbuf, inbuf, outlen); -#endif /* HAVE_ICONV */ } void conv_noconv(gchar *outbuf, gint outlen, const gchar *inbuf) @@ -829,7 +813,6 @@ void conv_code_converter_destroy(CodeConverter *conv) gint conv_convert(CodeConverter *conv, gchar *outbuf, gint outlen, const gchar *inbuf) { -#if HAVE_ICONV if (conv->code_conv_func != conv_noconv) conv->code_conv_func(outbuf, outlen, inbuf); else { @@ -843,9 +826,6 @@ gint conv_convert(CodeConverter *conv, gchar *outbuf, gint outlen, g_free(str); } } -#else /* !HAVE_ICONV */ - conv->code_conv_func(outbuf, outlen, inbuf); -#endif return 0; } @@ -867,11 +847,7 @@ gchar *conv_codeset_strdup(const gchar *inbuf, return g_realloc(buf, strlen(buf) + 1); } -#if HAVE_ICONV return conv_iconv_strdup(inbuf, src_code, dest_code); -#else - return g_strdup(inbuf); -#endif /* HAVE_ICONV */ } CodeConvFunc conv_get_code_conv_func(const gchar *src_charset_str, @@ -954,7 +930,6 @@ CodeConvFunc conv_get_code_conv_func(const gchar *src_charset_str, return code_conv; } -#if HAVE_ICONV gchar *conv_iconv_strdup(const gchar *inbuf, const gchar *src_code, const gchar *dest_code) { @@ -1045,7 +1020,6 @@ gchar *conv_iconv_strdup(const gchar *inbuf, return outbuf; } -#endif /* HAVE_ICONV */ static const struct { CharSet charset; @@ -1459,15 +1433,6 @@ CharSet conv_get_outgoing_charset(void) } } -#if !HAVE_ICONV - /* encoding conversion without iconv() is only supported - on Japanese locale for now */ - if (out_charset == C_ISO_2022_JP) - return out_charset; - else - return conv_get_locale_charset(); -#endif - return out_charset; } diff --git a/src/codeconv.h b/src/codeconv.h index 21539fd6..6a498af6 100644 --- a/src/codeconv.h +++ b/src/codeconv.h @@ -205,11 +205,9 @@ gchar *conv_codeset_strdup (const gchar *inbuf, CodeConvFunc conv_get_code_conv_func (const gchar *src_charset_str, const gchar *dest_charset_str); -#if HAVE_ICONV gchar *conv_iconv_strdup (const gchar *inbuf, const gchar *src_code, const gchar *dest_code); -#endif const gchar *conv_get_charset_str (CharSet charset); CharSet conv_get_charset_from_str (const gchar *charset); diff --git a/src/imap.c b/src/imap.c index d038162f..c454e855 100644 --- a/src/imap.c +++ b/src/imap.c @@ -3647,24 +3647,6 @@ static void imap_path_separator_subst(gchar *str, gchar separator) static gchar *imap_modified_utf7_to_locale(const gchar *mutf7_str) { -#if !HAVE_ICONV - const gchar *from_p; - gchar *to, *to_p; - - to = g_malloc(strlen(mutf7_str) + 1); - to_p = to; - - for (from_p = mutf7_str; *from_p != '\0'; from_p++) { - if (*from_p == '&' && *(from_p + 1) == '-') { - *to_p++ = '&'; - from_p++; - } else - *to_p++ = *from_p; - } - *to_p = '\0'; - - return to; -#else static iconv_t cd = (iconv_t)-1; static gboolean iconv_ok = TRUE; GString *norm_utf7; @@ -3731,29 +3713,10 @@ static gchar *imap_modified_utf7_to_locale(const gchar *mutf7_str) *to_p = '\0'; return to_str; -#endif /* !HAVE_ICONV */ } static gchar *imap_locale_to_modified_utf7(const gchar *from) { -#if !HAVE_ICONV - const gchar *from_p; - gchar *to, *to_p; - - to = g_malloc(strlen(from) * 2 + 1); - to_p = to; - - for (from_p = from; *from_p != '\0'; from_p++) { - if (*from_p == '&') { - *to_p++ = '&'; - *to_p++ = '-'; - } else - *to_p++ = *from_p; - } - *to_p = '\0'; - - return to; -#else static iconv_t cd = (iconv_t)-1; static gboolean iconv_ok = TRUE; gchar *norm_utf7, *norm_utf7_p; @@ -3863,7 +3826,6 @@ static gchar *imap_locale_to_modified_utf7(const gchar *from) g_string_free(to_str, FALSE); return to; -#endif /* !HAVE_ICONV */ } static GSList *imap_get_seq_set_from_msglist(GSList *msglist) diff --git a/src/mainwindow.c b/src/mainwindow.c index a7d200f3..17563d66 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -575,17 +575,14 @@ static GtkItemFactoryEntry mainwin_entries[] = {N_("/_View/_Code set/7bit ascii (US-ASC_II)"), CODESET_ACTION(C_US_ASCII)}, -#if HAVE_ICONV {N_("/_View/_Code set/Unicode (_UTF-8)"), CODESET_ACTION(C_UTF_8)}, CODESET_SEPARATOR, -#endif {N_("/_View/_Code set/Western European (ISO-8859-_1)"), CODESET_ACTION(C_ISO_8859_1)}, {N_("/_View/_Code set/Western European (ISO-8859-15)"), CODESET_ACTION(C_ISO_8859_15)}, CODESET_SEPARATOR, -#if HAVE_ICONV {N_("/_View/_Code set/Central European (ISO-8859-_2)"), CODESET_ACTION(C_ISO_8859_2)}, CODESET_SEPARATOR, @@ -609,18 +606,14 @@ static GtkItemFactoryEntry mainwin_entries[] = {N_("/_View/_Code set/Cyrillic (Windows-1251)"), CODESET_ACTION(C_CP1251)}, CODESET_SEPARATOR, -#endif {N_("/_View/_Code set/Japanese (ISO-2022-_JP)"), CODESET_ACTION(C_ISO_2022_JP)}, -#if HAVE_ICONV {N_("/_View/_Code set/Japanese (ISO-2022-JP-2)"), CODESET_ACTION(C_ISO_2022_JP_2)}, -#endif {N_("/_View/_Code set/Japanese (_EUC-JP)"), CODESET_ACTION(C_EUC_JP)}, {N_("/_View/_Code set/Japanese (_Shift__JIS)"), CODESET_ACTION(C_SHIFT_JIS)}, -#if HAVE_ICONV CODESET_SEPARATOR, {N_("/_View/_Code set/Simplified Chinese (_GB2312)"), CODESET_ACTION(C_GB2312)}, @@ -640,7 +633,6 @@ static GtkItemFactoryEntry mainwin_entries[] = CODESET_ACTION(C_TIS_620)}, {N_("/_View/_Code set/Thai (Windows-874)"), CODESET_ACTION(C_WINDOWS_874)}, -#endif #undef CODESET_SEPARATOR #undef CODESET_ACTION diff --git a/src/messageview.c b/src/messageview.c index 307ead0c..4691d52f 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -154,17 +154,14 @@ static GtkItemFactoryEntry msgview_entries[] = {N_("/_View/_Code set/7bit ascii (US-ASC_II)"), CODESET_ACTION(C_US_ASCII)}, -#if HAVE_ICONV {N_("/_View/_Code set/Unicode (_UTF-8)"), CODESET_ACTION(C_UTF_8)}, CODESET_SEPARATOR, -#endif {N_("/_View/_Code set/Western European (ISO-8859-_1)"), CODESET_ACTION(C_ISO_8859_1)}, {N_("/_View/_Code set/Western European (ISO-8859-15)"), CODESET_ACTION(C_ISO_8859_15)}, CODESET_SEPARATOR, -#if HAVE_ICONV {N_("/_View/_Code set/Central European (ISO-8859-_2)"), CODESET_ACTION(C_ISO_8859_2)}, CODESET_SEPARATOR, @@ -188,18 +185,14 @@ static GtkItemFactoryEntry msgview_entries[] = {N_("/_View/_Code set/Cyrillic (Windows-1251)"), CODESET_ACTION(C_CP1251)}, CODESET_SEPARATOR, -#endif {N_("/_View/_Code set/Japanese (ISO-2022-_JP)"), CODESET_ACTION(C_ISO_2022_JP)}, -#if HAVE_ICONV {N_("/_View/_Code set/Japanese (ISO-2022-JP-2)"), CODESET_ACTION(C_ISO_2022_JP_2)}, -#endif {N_("/_View/_Code set/Japanese (_EUC-JP)"), CODESET_ACTION(C_EUC_JP)}, {N_("/_View/_Code set/Japanese (_Shift__JIS)"), CODESET_ACTION(C_SHIFT_JIS)}, -#if HAVE_ICONV CODESET_SEPARATOR, {N_("/_View/_Code set/Simplified Chinese (_GB2312)"), CODESET_ACTION(C_GB2312)}, @@ -219,7 +212,6 @@ static GtkItemFactoryEntry msgview_entries[] = CODESET_ACTION(C_TIS_620)}, {N_("/_View/_Code set/Thai (Windows-874)"), CODESET_ACTION(C_WINDOWS_874)}, -#endif #undef CODESET_SEPARATOR #undef CODESET_ACTION diff --git a/src/prefs_common.c b/src/prefs_common.c index a951fea8..a448368f 100644 --- a/src/prefs_common.c +++ b/src/prefs_common.c @@ -1127,9 +1127,7 @@ static void prefs_send_create(void) SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO); SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII); -#if HAVE_ICONV SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8); -#endif SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1); SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15); SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2); @@ -1137,14 +1135,10 @@ static void prefs_send_create(void) SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4); SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7); SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9); -#if HAVE_ICONV SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5); -#endif SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R); -#if HAVE_ICONV SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_WINDOWS_1251); SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U); -#endif SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP); #if 0 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP); -- cgit v1.2.3