Subject: Re: [PATCH 1/2] libgit.a: add some UTF-8 handling functions

From: Uwe Kleine-König <[email-masked]>
Date: Sat, 23 Dec 2006 09:52:06 +0100

Hallo Johannes,

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.

Gruessle
Uwe

-- 
Uwe Kleine-König

http://www.google.com/search?q=2+to+the+power+of+12