/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#ifdef HAVE_CONFIG_H
static gchar *conv_iconv_strdup_with_cd (const gchar *inbuf,
iconv_t cd);
+static gchar *conv_iconv_strdup (const gchar *inbuf,
+ const gchar *src_code,
+ const gchar *dest_code);
+
static CharSet conv_get_locale_charset (void);
static CharSet conv_get_outgoing_charset (void);
static CharSet conv_guess_ja_encoding(const gchar *str);
size_t len;
CodeConvFunc conv_func;
+ if (!strcmp2(src_code, dest_code))
+ return g_strdup(inbuf);
+
src_code = conv_get_fallback_for_private_encoding(src_code);
conv_func = conv_get_code_conv_func(src_code, dest_code);
+ if (conv_func == conv_ustodisp && strict_mode && !is_ascii_str(inbuf))
+ return NULL;
+
if (conv_func != conv_noconv) {
len = (strlen(inbuf) + 1) * 3;
buf = g_malloc(len);
return code_conv;
}
-gchar *conv_iconv_strdup(const gchar *inbuf,
+static gchar *conv_iconv_strdup(const gchar *inbuf,
const gchar *src_code, const gchar *dest_code)
{
iconv_t cd;
{"ms_MY" , C_ISO_8859_1 , C_ISO_8859_1},
{"nl_BE" , C_ISO_8859_1 , C_ISO_8859_1},
{"nl_NL" , C_ISO_8859_1 , C_ISO_8859_1},
+ {"nb_NO" , C_ISO_8859_1 , C_ISO_8859_1},
{"nn_NO" , C_ISO_8859_1 , C_ISO_8859_1},
{"no_NO" , C_ISO_8859_1 , C_ISO_8859_1},
{"oc_FR" , C_ISO_8859_1 , C_ISO_8859_1},
*destp++ = ' '; \
left = MAX_LINELEN - 1; \
} \
+ } else if (destp == (guchar *)dest && left < 7) { \
+ if (isspace(*(destp - 1))) \
+ destp--; \
+ else if (is_plain_text && isspace(*srcp)) \
+ srcp++; \
+ if (*srcp) { \
+ *destp++ = '\n'; \
+ *destp++ = ' '; \
+ left = MAX_LINELEN - 1; \
+ } \
} \
} \
}
fs_file = g_filename_from_utf8(utf8_file, -1, NULL, NULL, &error);
if (error) {
- g_warning("failed to convert encoding of file name: %s\n",
+ debug_print("failed to convert encoding of file name: %s\n",
error->message);
g_error_free(error);
}