[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What does `undecided' do for encoding text?
From: |
Kenichi Handa |
Subject: |
Re: What does `undecided' do for encoding text? |
Date: |
Wed, 11 Feb 2009 18:20:34 +0900 |
In article <address@hidden>, Eli Zaretskii <address@hidden> writes:
> > From: Kenichi Handa <address@hidden>
> > CC: address@hidden
> > Date: Tue, 10 Feb 2009 20:16:53 +0900
> >
> > > This may have nothing to do with what the programmer did. My use case
> > > was in Rmail: if the original message had non-ASCII text encoded with
> > > QP or B64, Rmail would (correctly) return `undecided' when it detects
> > > the message encoding. Suppose you then edit the message and add
> > > non-ASCII characters as raw bytes, e.g. by base64-decode-region, and
> > > type "C-c C-c". rmail-cease-edit now needs to encode the text and put
> > > it back into the mbox buffer, and the immediate choice it has for the
> > > pertinent coding-system is to use buffer-file-coding-system of the
> > > buffer where the message was edited. But the value of
> > > buffer-file-coding-system in that buffer is `undecided'...
> >
> > The situation is the same as visiting an ASCII only file,
> > entering some non-ASCII characters, and saving it. In that
> > case, we use selecte-safe-coding-system to decide the coding
> > system to encode the buffer contents.
> I think that's a different situation: base64-decode-region inserts raw
> bytes, not non-ASCII characters. So select-safe-coding-system may not
> work correctly, because (AFAIK) it was not designed for that case.
Have you tried it? select-safe-coding-system should suggest
raw-text if the buffer contains raw bytes.
---
Kenichi Handa
address@hidden