summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-12-07 14:10:56 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-12-07 14:10:56 -0800
commitfff26a68053022a2cbc39142c7c6f6d016837058 (patch)
tree1ad5a3cd1a135213b3694f11fdcb52bcddec51b9 /utf8.h
parentMerge branch 'lt/diff-stat-show-0-lines' into maint (diff)
parentreencode_string(): introduce and use same_encoding() (diff)
downloadtgif-fff26a68053022a2cbc39142c7c6f6d016837058.tar.xz
Merge branch 'jc/same-encoding' into maint
Various codepaths checked if two encoding names are the same using ad-hoc code and some of them ended up asking iconv() to convert between "utf8" and "UTF-8". The former is not a valid way to spell the encoding name, but often people use it by mistake, and we equated them in some but not all codepaths. Introduce a new helper function to make these codepaths consistent. * jc/same-encoding: reencode_string(): introduce and use same_encoding()
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index 3c0ae7624e..93ef60042c 100644
--- a/utf8.h
+++ b/utf8.h
@@ -7,6 +7,7 @@ int utf8_width(const char **start, size_t *remainder_p);
int utf8_strwidth(const char *string);
int is_utf8(const char *text);
int is_encoding_utf8(const char *name);
+int same_encoding(const char *, const char *);
int strbuf_add_wrapped_text(struct strbuf *buf,
const char *text, int indent, int indent2, int width);