path: root/utf8.h
diff options
authorJunio C Hamano <>2015-04-16 17:45:29 (GMT)
committerJunio C Hamano <>2015-04-16 18:35:06 (GMT)
commitdde843e7378f65004415bd108038659de9ce2abd (patch)
treedd977fbe55195fc53032b60705905b317a1e2b5b /utf8.h
parentcb0abea87017559e1db3721a7e6d89a336d845e9 (diff)
utf8-bom: introduce skip_utf8_bom() helper
With the recent change to ignore the UTF8 BOM at the beginning of .gitignore files, we now have two codepaths that do such a skipping (the other one is for reading the configuration files). Introduce utf8_bom[] constant string and skip_utf8_bom() helper and teach .gitignore code how to use it. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'utf8.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index e4d9183..e7b2aa4 100644
--- a/utf8.h
+++ b/utf8.h
@@ -13,6 +13,9 @@ int same_encoding(const char *, const char *);
__attribute__((format (printf, 2, 3)))
int utf8_fprintf(FILE *, const char *, ...);
+extern const char utf8_bom[];
+extern int skip_utf8_bom(char **, size_t);
void strbuf_add_wrapped_text(struct strbuf *buf,
const char *text, int indent, int indent2, int width);
void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,