because they return a static buffer. Thanks to Alexander Zangerl
for tracking this down, when using an ISO-8859-1 locale.
/* norm_charmap() is case sensitive. */
char *src_charset_u = upcase (src_charset);
char *dest_charset_u = upcase (dest_charset);
/* norm_charmap() is case sensitive. */
char *src_charset_u = upcase (src_charset);
char *dest_charset_u = upcase (dest_charset);
- int different_charsets =
- strcmp (norm_charmap (src_charset), norm_charmap (dest_charset));
+ char *src_charset_n = getcpy (norm_charmap (src_charset));
+ char *dest_charset_n = getcpy (norm_charmap (dest_charset));
+ int different_charsets = strcmp (src_charset_n, dest_charset_n);
+ free (dest_charset_n);
+ free (src_charset_n);
free (dest_charset_u);
free (src_charset_u);
free (dest_charset_u);
free (src_charset_u);
static int
convert_content_charset (CT ct, char **file) {
static int
convert_content_charset (CT ct, char **file) {
#ifdef HAVE_ICONV
/* Using current locale, see if the content needs to be converted. */
#ifdef HAVE_ICONV
/* Using current locale, see if the content needs to be converted. */
if (! check_charset (charset, strlen (charset))) {
int unused = 0;
if (! check_charset (charset, strlen (charset))) {
int unused = 0;
- if (convert_charset (ct, get_charset (), &unused) == 0) {
+ char *charset = getcpy (get_charset ());
+
+ if (convert_charset (ct, charset, &unused) == 0) {
*file = ct->c_cefile.ce_file;
} else {
*file = ct->c_cefile.ce_file;
} else {
}
#else /* ! HAVE_ICONV */
NMH_UNUSED (ct);
NMH_UNUSED (file);
#endif /* ! HAVE_ICONV */
}
#else /* ! HAVE_ICONV */
NMH_UNUSED (ct);
NMH_UNUSED (file);
#endif /* ! HAVE_ICONV */