projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Andreas Krennmair:
[apps/madmutt.git]
/
charset.c
diff --git
a/charset.c
b/charset.c
index
19c3a2b
..
4dc0f3b
100644
(file)
--- a/
charset.c
+++ b/
charset.c
@@
-19,6
+19,9
@@
* Boston, MA 02111, USA.
*/
* Boston, MA 02111, USA.
*/
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <string.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
@@
-196,6
+199,7
@@
PreferredMIMENames[] =
/* seems to be common on some systems */
{ "sjis", "Shift_JIS" },
/* seems to be common on some systems */
{ "sjis", "Shift_JIS" },
+ { "euc-jp-ms", "eucJP-ms" },
/*
/*
@@
-379,18
+383,24
@@
size_t mutt_iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t *inbytesleft,
if (*t)
continue;
}
if (*t)
continue;
}
- if (outrepl)
+ /* Replace the output */
+ if (!outrepl)
+ outrepl = "?";
+ iconv (cd, 0, 0, &ob, &obl);
+ if (obl)
{
{
- /* Try replacing the output */
int n = strlen (outrepl);
int n = strlen (outrepl);
- if (n
<=
obl)
+ if (n
>
obl)
{
{
- memcpy (ob, outrepl, n);
- ++ib, --ibl;
- ob += n, obl -= n;
- ++ret;
- continue;
+ outrepl = "?";
+ n = 1;
}
}
+ memcpy (ob, outrepl, n);
+ ++ib, --ibl;
+ ob += n, obl -= n;
+ ++ret;
+ iconv (cd, 0, 0, 0, 0); /* for good measure */
+ continue;
}
}
*inbuf = ib, *inbytesleft = ibl;
}
}
*inbuf = ib, *inbytesleft = ibl;