Subject: bug#1051: 23.0.60; rmail decoding bug

From: Kenichi Handa <[email-masked]>
Date: Tue, 30 Sep 2008 19:59:08 +0900

In article <[email-masked]>, Eli Zaretskii <[email-masked]> 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.

By the way, we still don't have a proper API for reading an
eight-bit character as byte.  What we can do now for that is
something like these:
  (multibyte-char-to-unibyte (char-after POS))
or
  (encode-char (char-after POS) 'eight-bit)

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?

---
Kenichi Handa
[email-masked]