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

Re: [PATCH] Reencode committer info to utf-8 before formatting mail header

From
David Kågedal <davidk@lysator.liu.se>
Date
Jan 15, 2007, 16:57 UTC
Message-ID
<87bql0449j.fsf@morpheus.local>
In-Reply-To
<7vr6tzogp4.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 9 quoted lines
> -static int add_rfc2047(char *buf, const char *line, int len)
> +static int add_rfc2047(char *buf, const char *line, int len,
> +		       const char *encoding)
>  {
>  	char *bp = buf;
>  	int i, needquote;
> -	static const char q_utf8[] = "=?utf-8?q?";
> +	char q_encoding[128];
> +	const char *q_encoding_fmt = "=?%s?q?";

This goes against the old principle of being forgiving in what you accept, and strict in what you send. The names of the encoding in the headers should probably be normalized before putting them in an e-mail. I.e. we might accept "utf-8", "utf8", "UTF-8", and "UTF8" (this depends on iconv, I suppose), but the RFC2047 encoding should be the one blessed by RFC4027. But I admit that I haven't read the RFC, and I'm writing this offline so I can't check right now.

-- 
David Kågedal
Previous: Junio C HamanoNext: David Kågedal
Message 17 of 18 in “Reencode committer info to utf-8 before formatting mail header”
  1. Reencode committer info to utf-8 before formatting mail headerDavid Kågedal, Jan 12, 2007
  2. Junio C HamanoJan 12, 2007
  3. Junio C HamanoJan 13, 2007
  4. Junio C HamanoJan 13, 2007
  5. Johannes SchindelinJan 13, 2007
  6. Junio C HamanoJan 13, 2007
  7. David KågedalJan 15, 2007
  8. Johannes SchindelinJan 16, 2007
  9. David KågedalJan 16, 2007
  10. Robin RosenbergJan 13, 2007
  11. Junio C HamanoJan 13, 2007
  12. David KågedalJan 15, 2007
  13. Alex RiesenJan 13, 2007
  14. Horst H. von BrandJan 14, 2007
  15. Alex RiesenJan 14, 2007
  16. Junio C HamanoJan 13, 2007
  17. David KågedalJan 15, 2007
  18. David KågedalJan 15, 2007

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.