git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: xiaozhu <xiaozhu@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: a bug about format-patch of multibyte characters comment
Date: Sun, 13 Feb 2011 05:23:08 -0500	[thread overview]
Message-ID: <20110213102307.GA7735@sigill.intra.peff.net> (raw)
In-Reply-To: <4D57AEFC.10608@gmail.com>

On Sun, Feb 13, 2011 at 07:14:20PM +0900, xiaozhu wrote:

> I am not similar with mail format. I read the rfc2047 again, but I didn't
> see any description about line separator encoding. Perhaps a base64 encoded-word
> will contain the line separator involuntarily? I also found a sample in
> rfc2047 it show us a line broken subject mail, but it didn't say any thing
> about line separator encoding.

If the encoded-word contains the line separator, wouldn't it be a
literal character in the header value then? I.e., using rfc2047 you can
embed a literal newline into your subject (or possibly, a 0x0a byte may
be part of a multi-byte character; that can't happen in utf8, but I
believe it can in utf16).

> A sample of rfc2047 show us a legal line broken subject mail, like following:
> ------------------------------------------------------------------
>  Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
>     =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
> ------------------------------------------------------------------
> 
> I understand that the current format-patch is not not valid to rfc2822/rfc2047,
> but even a valid one just like above, most of the mail client will can not show it
> correctly, they show the first line only, I think that's a problem of user
> friendliness.

Then those mail clients are broken. That should first be unfolded to put
both encoded-words on the same line (separated by whitespace, I think,
though it doesn't matter for encoded words), and then each encoded word
should be decoded (the resulting text is "If you can read this you
understand the example.").

Mutt and other MUAs do this just fine. If you have a MUA that doesn't,
complain to the author.

-Peff

  parent reply	other threads:[~2011-02-13 10:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12 10:13 a bug about format-patch of multibyte characters comment xiaozhu
2011-02-12 12:30 ` "Martin Krüger"
2011-02-13  7:53 ` Jeff King
2011-02-13  8:31   ` Jeff King
2011-02-13  8:45     ` xiaozhu
2011-02-13  8:52       ` Jeff King
2011-02-13 10:14         ` xiaozhu
2011-02-13 10:22           ` xzer
2011-02-13 10:26             ` Jeff King
2011-02-13 10:50               ` xiaozhu
2011-02-13 10:23           ` Jeff King [this message]
2011-02-13  9:48   ` Johannes Sixt
2011-02-13 10:03     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110213102307.GA7735@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=xiaozhu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).