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

Re: a bug about format-patch of multibyte characters comment

From
Jeff King <peff@peff.net>
Date
Feb 13, 2011, 10:23 UTC
Message-ID
<20110213102307.GA7735@sigill.intra.peff.net>
In-Reply-To
<4D57AEFC.10608@gmail.com>
On Sun, Feb 13, 2011 at 07:14:20PM +0900, xiaozhu wrote:
Show 5 quoted lines
> 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).

Show 10 quoted lines
> 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
Previous: xiaozhuNext: Johannes Sixt
Message 11 of 13 in “a bug about format-patch of multibyte characters comment”
  1. xiaozhuFeb 12, 2011
  2. Martin KrügerFeb 12, 2011
  3. Jeff KingFeb 13, 2011
  4. Jeff KingFeb 13, 2011
  5. xiaozhuFeb 13, 2011
  6. Jeff KingFeb 13, 2011
  7. xiaozhuFeb 13, 2011
  8. xzerFeb 13, 2011
  9. Jeff KingFeb 13, 2011
  10. xiaozhuFeb 13, 2011
  11. Jeff KingFeb 13, 2011
  12. Johannes SixtFeb 13, 2011
  13. Jeff KingFeb 13, 2011

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.