GNU bug report logs -
#1051
23.0.60; rmail decoding bug
Previous Next
Reported by: rms <at> gnu.org
Date: Mon, 29 Sep 2008 17:25:04 UTC
Severity: normal
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Kenichi Handa <handa <at> m17n.org>
> CC: 1051 <at> emacsbugs.donarmstrong.com, rms <at> gnu.org, emacs-pretest-bug <at> gnu.org,
> bug-gnu-emacs <at> gnu.org
> Date: Tue, 30 Sep 2008 19:59:08 +0900
>
> In article <uljxajac7.fsf <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > The problem is within mail-unquote-printable-region: it relies on
> > insert-char to insert a unibyte character, even if the target buffer
> > is a multibyte buffer. In Emacs 22.x this works, but not in Emacs 23.
>
> > Perhaps Handa-san can suggest what is the best way of inserting
> > unibyte characters into a multibyte buffer in Emacs 23. Obviously,
> > insert-file-contents does that when coding-system-for-read is bound to
> > no-conversion.
>
> The Lisp API for that is insert-byte.
Thanks, this indeed fixes the problem.
Richard, please see if the patch below fixes the problem for you as
well.
> It may be good to provide byte-after, following-byte, and
> preceding-byte (all signal an error if the character is not
> an ASCII nor eight-bit character). What do you think?
I agree that it would be nice to have such a feature, but perhaps a
single API
(get-byte POS)
would be enough? This could default to point if POS is nil or
omitted, and could even read from a string if POS is a string.
2008-09-30 Eli Zaretskii <eliz <at> gnu.org>
* mail/mail-utils.el (mail-unquote-printable-region): Use
insert-byte instead of insert-char, when the UNIBYTE arg is
non-nil.
Index: lisp/mail/mail-utils.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/mail-utils.el,v
retrieving revision 1.65
retrieving revision 1.66
diff -c -r1.65 -r1.66
*** lisp/mail/mail-utils.el 6 May 2008 07:22:25 -0000 1.65
--- lisp/mail/mail-utils.el 30 Sep 2008 11:53:21 -0000 1.66
***************
*** 141,148 ****
(if unibyte
(progn
(replace-match "")
! ;; insert-char will insert this as unibyte,
! (insert-char char 1))
(replace-match (make-string 1 char) t t))))
(noerror
(setq failed t))
--- 141,149 ----
(if unibyte
(progn
(replace-match "")
! ;; insert-byte will insert this as a
! ;; corresponding eight-bit character.
! (insert-byte char 1))
(replace-match (make-string 1 char) t t))))
(noerror
(setq failed t))
This bug report was last modified 15 years and 247 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.