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

Re: [PATCH 1/2] [RFC] add --recode-patch option to git-mailinfo

From
Zhang Le <r0bertz@gentoo.org>
Date
Jun 7, 2010, 01:44 UTC
Message-ID
<20100607014434.GA24220@adriano>
In-Reply-To
<7vr5kkvshz.fsf@alter.siamese.dyndns.org>
On 13:03 Sun 06 Jun     , Junio C Hamano wrote:
Show 20 quoted lines
> Zhang Le <r0bertz@gentoo.org> writes:
> 
> > I have a translation project which uses UTF-8 as charset.
> > So the patch must be encoded in UTF-8, not just the commit msg etc.
> > And we use google group as our mailing list.
> >
> > Recently, due to unknown reason, mails saved from gmail are encoded using GB2312.
> > This never happened before. I guess google has did something.
> > But I haven't found how to change this behavior.
> >
> > So I took another way, i.e. add this option to git-mailinfo.
> > I hope this could benefit others as well.
> >
> > Signed-off-by: Zhang Le <r0bertz@gentoo.org>
> > ---
> >  builtin/mailinfo.c  |    8 +++++++-
> >  man1/git-mailinfo.1 |    7 ++++++-
> 
> Don't patch anything in man?/ as they are autogenerated files and not
> source; patch the source file in Documentation/ directory instead.
Thanks, will do it.
Show 6 quoted lines
> 
> I take it that you recode from whatever encoding the mail message is in
> (probably stated in "Content-type: ...; charset=xxx" header) to the
> encoding specified with --encoding option (defaulting to UTF-8), but it
> wasn't very clear from the documentation.  We might want to improve 
> the descriptions of both this new option and --encoding option.

That's exactly what this patch's purpose is. I will try to improve the doc.

> 
> Also it might be useful to find out what that "due to unknown reason" is,
> at least to see if that is what Google did or what the user did.

One of my friend, Yang Xiaoguang, found that google tries to detect the language of the email and recode it using the native charset. For Simplified Chinese, it is GB2312. For Traditional Chinese, it is Big5.

In the test, Yang sent all emails using UTF-8 charset. He sent those mails to a google group and then checked the "Content-type: ...; charset=xxx" in gmail.

If the mail is written in Simplified Chinese, the charset became GB2312. If the mail is written in Traditional Chinese, the charset became Big5. If the mail is mixed with Simplified and Traditional Chinese, the charset remains as UTF-8.

-- 
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
Previous: Junio C Hamano
Message 4 of 4 in “[RFC] add --recode-patch option to git-mailinfo”
  1. 1/2 [RFC] add --recode-patch option to git-mailinfoZhang Le, Jun 6, 2010
  2. 2/2 [RFC] add --recode-patch to git-amZhang Le, Jun 6, 2010
  3. Junio C HamanoJun 6, 2010
  4. Zhang LeJun 7, 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.