Re: [PATCH 1/2] libgit.a: add some UTF-8 handling functions
- From
Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>
- Date
- Dec 23, 2006, 08:52 UTC
- Message-ID
- <20061223085206.GA2189@cepheus>
- In-Reply-To
- <Pine.LNX.4.63.0612230048350.19693@wbgn013.biozentrum.uni-wuerzburg.de>
Hallo Johannes,
Johannes Schindelin wrote:
Show 7 quoted lines
> @@ -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.
Gruessle Uwe
-- Uwe Kleine-König http://www.google.com/search?q=2+to+the+power+of+12