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

git-am fails for emails with UTF8 characters in email header

From
SCSiddharth Chandrasekaran <siddharth@embedjournal.com>
Date
Sep 13, 2019, 20:07 UTC
Message-ID
<16d2c3ccc40.b3c71baf1200589.723645117669598677@embedjournal.com>
Hi Junio,

My email server (zoho) puts leading UTF-8 non-breaking spaces ("\xC2\xA0") when folding long mail headers. Due to this, git-am is failing as it expects only '\t' or ' ' characters.

RFC2822 [1] on page 7 states:
> The general rule is that wherever this standard allows for folding white
> space (not simply WSP characters), a CRLF may be inserted before any WSP.

It appears the RFC isn't too strict about ASCII only headers (correct me if I'm wrong here); ergo, if the mail file is in UTF-8, isn't logical to expect UTF-8 whitespace characters also to be allowed in the fold/unfold of headers?

I was able to get git-am to work with modifications to read_one_header_line() in mailinfo.c need your view on whether a patch is necessary for this. If so, I can send a patch for this.

Thanks Sid.

Footnotes: [1]: https://www.ietf.org/rfc/rfc2822.txt

Next: brian m. carlson
Message 1 of 2 in “git-am fails for emails with UTF8 characters in email header”
  1. Siddharth ChandrasekaranSep 13, 2019
  2. brian m. carlsonSep 13, 2019

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.