Created attachment 391890 [details] mutt-vim-reply-bug.mbox Full story at http://dev.mutt.org/trac/ticket/3718 In short, all current versions in portage (1.5.22-r3 - 1.5.23-r4) has utf8-related off-by-one bug in gentoo-specific 07-quote.patch. To see this issue open attached mutt-vim-reply-bug.mbox - it contains just one email - and try to reply to this email. Mutt will output broken utf8 to $EDITOR (last symbol in quoted line will have only first of two utf8 bytes). You can use this to catch file with mutt's output: $ EDITOR="cp -t ." /usr/bin/mutt -n -F /dev/null -f /tmp/mutt-vim-reply-bug.mbox $ ls -ltr # last (newest) file is the one To make sure problem is in mentioned patch just add this: sed -i '/handler.c/,$d' "${PATCHDIR}"/07-quote.patch into ebuild before: for p in "${PATCHDIR}"/[0-9][0-9]-*.patch ; do (it will disable that patch without breaking following patches).
I'd be willing to bet this is because the patch uses char qbuf[2 * LONG_STRING]; Where LONG_STRING is 1024. Your sample email is one long line of length 2047. Add the quoted string "> " and voila, the snprintf will truncate the last byte.
I've created an alternative patch, which I'm testing at the moment.
please test 1.5.23-r5
Assuming fixed.