8

Why the web-version of Gmail line-wrap its mail content without marking the breaking place with a =, which make email processing very difficult:

See the original mail content sent by gmail:

enter image description here

and this mail sent by Mac OS X Mail:

enter image description here

Edited:

As Brandon Invergo said, they are using different encoding method. I am sorry that I said GMail is not decent.

Edited 2:

Their original content are:

enter image description here

They are wrapped in Gmail, I guess it is according to word-wrap algorithm.

Community
  • 1
  • 1
Xiaofan Hu
  • 1,482
  • 1
  • 16
  • 22

2 Answers2

8

So, there are two separate issues here, and GMail is doing one of them "a different way" and one of them "the wrong way."

First is the issue of encoding. You're correct; GMail is using the UTF-8 character set for plain text mails by default, while Mac OS X Mail is using Quoted Printable, which is MIME content transfer encoding.

The second issue is word wrapping. RFC 2822 specifies that lines should be 78 characters or fewer (not including the CR+LF. Google solves this problem by (rather aggressively) introducing hard word wrapping, which looks ugly when displayed on smaller screens, etc. Most other mail clients use the features of quoted printable to introduce soft line breaks to comply with this recommendation. That allows mail clients to tell the difference between a "hard" (ie user-intended) and "soft" (ie introduced by the client) line break.

There is no reason GMail couldn't use this Quoted Printable convention instead of UTF-8, or use Format=Flowed (RFC 2646, FAQ) to achieve the same results. These have both been around a while, and it's a little silly that GMail is forcing word wrap on plain-text users, in my opinion.

A good primer on this whole situation is here.

Community
  • 1
  • 1
  • 1
    Another unfortunate side-effect of this is that GPG signatures are broken by Gmail's poor choice of encoding method. `gpg --clear-sign` text copied and pasted directly into Gmail and sent gets word wrapped by inserting `\n` newline chars, and even re-encoded in partially `quoted-printable` encoding... including `base64` characters that may appear in the signature. Such as: equals sign `=` replaced with `=3D`. This effectively breaks the cryptographic signature and the client reading it will show the message as having a bad signature. – TrinitronX Jun 26 '20 at 18:40
1

GMail is sending the text using UTF-8 character encoding, as indicated in the content type. The Mac email client is sending using Quoted-printable encoding. Both are used to send characters that are outside the ASCII range. GMail is sending 8-bit clean messages while Mail is sending 7-bit messages. The 7-bit messages should be more space efficient, but I would hesitate to say that a mail client that does not use them is somehow not "decent."

  • Then does it possible to unwrap mails sent in UTF-8 character encoding? – Xiaofan Hu Jul 11 '13 at 10:13
  • I see. I'm not entirely sure. If the original content was completely not wrapped, so that each paragraph was all on one line, you can go through and remove any newlines unless there are two in a row, which would indicate a paragraph break. –  Jul 12 '13 at 06:59