jeremy-compostella / org-msg

OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
GNU General Public License v3.0
280 stars 60 forks source link

Can't forward email: These default coding systems were tried to encode text… #37

Closed svictor9 closed 4 years ago

svictor9 commented 4 years ago

When I try to forward this email and org-msg-mode is enabled I get the following error:

These default coding systems were tried to encode text
in the buffer ‘202013031120.73fcrtr4ejtjj@ab.d.mailin.fr’:
  (utf-8-unix (516 . 4194285) (558 . 4194270))
However, each of them encountered characters it couldn’t encode:
  utf-8-unix cannot encode these:  \335 \336

Click on a character (or switch to this window by ‘C-x o’
and select the characters by RET) to jump to the place it appears,
where ‘C-u C-x =’ will give information about it.

Select one of the safe coding systems listed below,
or cancel the writing with C-g and edit the buffer
   to remove or modify the problematic characters,
or specify any other coding system (and risk losing
   the problematic characters).

  raw-text no-conversion

The other window displays the message source in unix-utf-8 coding system. I can see indeed two offending chars marked as \335 and \446 They disappear when I copy/paste the text here, but if I add them manually, it reads:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.qw3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta http-equiv="X-UA-Compatible" content="IE\355ge"/><meta name="viewport" content="width\336vice-width, initial-scale=1"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="x-apple-disable-message-reformatting"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><meta name="format-detection" content="telephone=no"/><title></title>

The messages buffer prints these errors which I believe are from org-msg

Malformed quoted-printable text [318 times]
Saving file /tmp/202013031120.73fcrtr4ejtjj@ab.d.mailin.fr...
Buffer 202013031120.73fcrtr4ejtjj@ab.d.mailin.fr modified; kill anyway? (y or n) n
error in process filter: apply: Wrong number of arguments: (8 . 8), 10
error in process filter: Wrong number of arguments: (8 . 8), 10

I use mu4e, which displays the contents of this message just fine. For that the mu4e-view buffer uses utf-8-unix coding system. But when I display the message source from mu4e, the buffer is iso-latin-1-unix. With this coding system, the source is correctly displayed.

To sum up, as far as I can understand, org-msg seems to stumble in trying to represent the message source using a utf-8-unix buffer, while the message source has chars which are not encoded as utf-8.

The same problem occurred on three other emails (from various senders) prior to this bug report. Disabling org-msg-mode solves the problem allowing me to forward the message using mu4e.

Note: the attached email.txt file is a direct upload of the email file as it sits on my disk, not as displayed by emacs. i hope that it can help to reproduce the problem.

jeremy-compostella commented 4 years ago

Email forwarding is not supported by org-msg. If you face a similar issue while replying to an email it could be interesting. I don't know how to load an email in gnus without going through a lot of configuration.

jsravn commented 4 years ago

I am trying to use org-mode in mu4e and I am having the same issue when replying to HTML emails:

These default coding systems were tried to encode text
in the buffer ‘0102017039d471c9-620a97ac-a64c-49ea-a1e8-4759800d9b4d-000000@eu-west-1.amazonses.com’:
  (utf-8 (304 . 4194270) (441 . 4194285) (13023 . 4194194) (17585 . 4194176) (18604 . 4194303) (22355 . 4194248))
However, each of them encountered characters it couldn’t encode:
  utf-8 cannot encode these: � � � � � �

Click on a character (or switch to this window by ‘SPC w C-w’
and select the characters by RET) to jump to the place it appears,
where ‘SPC u g a’ will give information about it.

Select one of the safe coding systems listed below,
or cancel the writing with C-g and edit the buffer
   to remove or modify the problematic characters,
or specify any other coding system (and risk losing
   the problematic characters).

  raw-text no-conversion

The encoding errors are when it's trying to quote the original email it seems. This works fine with org-mu4e-compose-mode which is what I was using before. Any ideas?

jsravn commented 4 years ago

Seems to be happening with the temp file created by org-msg-save-article-for-reply-mu4e - when this file is opened, the "default coding system" popup described above happens.