Subject: Re: bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE

From: Mattias Engdegård <[email-masked]>
Date: Mon, 6 Apr 2020 17:56:27 +0200

6 apr. 2020 kl. 16.21 skrev Eli Zaretskii <[email-masked]>:

> Kenichi, why was coding-type of UTF-7 systems set to 'utf-8'?
> Wouldn't it be better to set it to 'utf-16'?  Or is there some
> subtlety here that we should be aware of?  Do you have any comments on
> the patch below?

There is no reason why utf-7[-imap] should have utf-8 as coding-type, is there? utf-16 is definitely wrong (utf-7* are encoded in ASCII). What about the patch below instead?

By the way, there appears to be another, unrelated bug in utf-7-imap: According to RFC 2060, all C0 controls are base64-encoded, but in Emacs some of them are passed through unchanged (CR, LF and TAB). This is permitted by plain UTF-7 (RFC 1642) but not in the IMAP variant.