commit-tree: cope with different ways "utf-8" can be spelled.
People can spell config.commitencoding differently from what we
internally have ("utf-8") to mean UTF-8. Try to accept them and
treat them equally.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
9
utf8.c
9
utf8.c
@ -277,6 +277,15 @@ void print_wrapped_text(const char *text, int indent, int indent2, int width)
|
||||
}
|
||||
}
|
||||
|
||||
int is_encoding_utf8(const char *name)
|
||||
{
|
||||
if (!name)
|
||||
return 1;
|
||||
if (!strcasecmp(name, "utf-8") || !strcasecmp(name, "utf8"))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a buffer and its encoding, return it re-encoded
|
||||
* with iconv. If the conversion fails, returns NULL.
|
||||
|
||||
Reference in New Issue
Block a user