Search code examples
gmailemail-processing

Why isn't Gmail using quoted-printable encoding?


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.


Solution

  • 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.