Re: [PATCH 1/2] libgit.a: add some UTF-8 handling functions
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 23, 2006, 14:12 UTC
- Message-ID
- <Pine.LNX.4.63.0612231510130.19693@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <20061223085206.GA2189@cepheus>
Hi,
On Sat, 23 Dec 2006, Uwe Kleine-König wrote:
Show 15 quoted lines
> Johannes Schindelin wrote:
> > @@ -127,6 +128,15 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
> > while (fgets(comment, sizeof(comment), stdin) != NULL)
> > add_buffer(&buffer, &size, "%s", comment);
> >
> > + /* And check the encoding */
> > + buffer[size] = '\0';
> > + if (!strcmp(git_commit_encoding, "utf-8") && !is_utf8(buffer)) {
> Maybe you could be more generous here. E.g.
>
> if ((!strcasecmp(git_commit_encoding, "utf-8") ||
> !strcasecmp(git_commit_encoding, "utf8")) && !is_utf8(buffer))
>
> Junio suggested to make this check if i18n.commitEncoding is empty. I
> didn't check the code to see if this case is included.The problem is, as I pointed out in another mail, that environment.c sets the default git_commit_encoding to "utf-8". This is hardwired, and I have no way to check if that was set by the config or not, other than reparsing the config myself.
> Gruessle
Hah! You don't use umlauts and ssharp yourself!
Ciao, Dscho