git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: vger doesn't like UTF-8 from send-email

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Jun 14, 2010, 11:57 UTC
Message-ID
<AANLkTinH7p6_WV1FK7UTZLg-8OGINZFnYMA1kENb6PkW@mail.gmail.com>
In-Reply-To
<AANLkTim1QajqLOp4y6-oIMAGp8Tkf7z9uTH6bwIIFYkH@mail.gmail.com>
On Sun, Jun 13, 2010 at 6:15 AM, Michael Witten <mfwitten@gmail.com> wrote:
Show 68 quoted lines
> On Sat, Jun 12, 2010 at 05:11, Thomas Rast <trast@student.ethz.ch> wrote:
>> AFAICT the original message did not declare an encoding:
>>
>> Subject: [PATCH v2 0/2] bash completion: Support "divergence from upstream" warnings in __git_ps1
>> Date: Sat, 12 Jun 2010 12:02:14 +0200
>> Message-ID: <cover.1276336602.git.trast@student.ethz.ch>
>> X-Mailer: git-send-email 1.7.1.561.g94582
>> In-Reply-To: <20100612000002.GA30196@neumann>
>> References: <20100612000002.GA30196@neumann>
>> MIME-Version: 1.0
>> Content-Type: text/plain
>> Return-Path: trast@student.ethz.ch
>> ...
>> Is this a new vger policy, or am I hitting a send-email bug?
>
> Let's assume the headers themselves are already properly encoded.
>
> According to:
>
>    http://www.faqs.org/rfcs/rfc2045.html
>
> we have:
>
>    The proper Content-Transfer-Encoding
>    label must always be used.
>
> and:
>
>    An encoding type of 7BIT requires that
>    the body is already in a 7bit mail-ready
>    representation.  This is the default value
>    -- that is, "Content-Transfer-Encoding: 7BIT"
>    is assumed if the Content-Transfer-Encoding
>    header field is not present.
>
> Moreover, according to:
>
>    http://www.faqs.org/rfcs/rfc2046.html
>
> we have:
>
>    4.1.2    Charset Parameter
>    ...
>    The default character set, which must be
>    assumed in the absence of a charset parameter,
>    is US-ASCII.
>
> So, your email is indeed incorrect in 2 ways if the body contains
> UTF-8 encoded data.
>
> From what I've skimmed, the mail user agent (MUA)---such as
> send-email---could send your unmodified message body by producing
> these headers:
>
>    MIME-Version: 1.0
>    Content-type: text/plain; charset=utf-8
>    Content-transfer-encoding: 8bit
>
> but only 7bit transfer encodings are guaranteed to make it intact to
> the destination; consequently, it would probably be a good idea for
> the MUA to transform your message into some 7bit encoding, preferably
> a human-readable one such as the 'quoted-printable' encoding; after
> such a transformation, the headers could be:
>
>    MIME-Version: 1.0
>    Content-type: text/plain; charset=utf-8
>    Content-transfer-encoding: quoted-printable
>

QP-encoding is sometimes destructive, and as such not recommended for patches - in fact, Documentation/SubmittingPatches forbid it. For the cover-letter the destruction might not be an issue (IIRC it's some line-feeds that might be added because QP can a line longer than the maximum line-length), but special casing the encoding for cover-letters doesn't strike me as The Right Thing To Do(tm).

I think the only real alternative to 8-bit encoding is Base64, and it sacrifices human-readability. Dunno how bad that is, though.

-- 
Erik "kusma" Faye-Lund
Previous: Michael WittenNext: Andrew Sayers
Message 12 of 22 in “bash completion: Support "divergence from upstream" warnings in __git_ps1”
  1. 0/2 bash completion: Support "divergence from upstream" warnings in __git_ps1Thomas Rast, Jun 12, 2010
  2. 1/2 rev-list: introduce --count optionThomas Rast, Jun 12, 2010
  3. 2/2 bash completion: Support "divergence from upstream" warnings in __git_ps1Thomas Rast, Jun 12, 2010
  4. Junio C HamanoJun 14, 2010
  5. Thomas RastJun 14, 2010
  6. SZEDER GáborJun 14, 2010
  7. vger doesn't like UTF-8 from send-emailThomas Rast, Jun 12, 2010
  8. send-email: ask about and declare 8bit mailsThomas Rast, Jun 12, 2010
  9. Junio C HamanoJun 12, 2010
  10. Thomas RastJun 13, 2010
  11. Michael WittenJun 13, 2010
  12. Erik Faye-LundJun 14, 2010
  13. bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 12, 2010
  14. Thomas RastJun 14, 2010
  15. [PATCHv4] bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 15, 2010
  16. Junio C HamanoJun 16, 2010
  17. Thomas RastJun 16, 2010
  18. 0/2 bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 17, 2010
  19. Junio C HamanoJun 18, 2010
  20. Andrew SayersJun 18, 2010
  21. 1/2 bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers, Jun 17, 2010
  22. 2/2 bash-completion: Fix __git_ps1 to work with "set -u"Andrew Sayers, Jun 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.