Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-30 23:20:43 +0300
committerJunio C Hamano <junkio@cox.net>2006-12-31 02:58:43 +0300
commit677cfed56ac530878b746ee4cca3ada8af384a81 (patch)
tree19b8162432db50d0940067236af6ec8791a9ac03 /utf8.c
parent7cbcf4d5579bdc5d9f8a4bf3f37d3390fc6e2572 (diff)
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>
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index 1eedd8b61a..7c80eeccb4 100644
--- a/utf8.c
+++ b/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.