From 11f2be2bcc264aa4f24cdad036231e34d09f5630 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 1 Aug 2015 23:25:50 +0200 Subject: charset_conv: make it possible to return an allocated string as guess uchardet is written in C++, and thus doesn't appreciate the value of using static strings, and internally stores the guessed charset as allocated std::string. Add a minimal hack to deal with this. (I don't appreciate that the code is potentially harder to understand by returning either a static or allocated string, but I do appreciate for not having to litter the existing code with strdups.) --- misc/charset_conv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'misc/charset_conv.h') diff --git a/misc/charset_conv.h b/misc/charset_conv.h index 93bd91cffe..bd76ae007a 100644 --- a/misc/charset_conv.h +++ b/misc/charset_conv.h @@ -14,8 +14,8 @@ enum { bool mp_charset_is_utf8(const char *user_cp); bool mp_charset_requires_guess(const char *user_cp); -const char *mp_charset_guess(struct mp_log *log, bstr buf, const char *user_cp, - int flags); +const char *mp_charset_guess(void *talloc_ctx, struct mp_log *log, bstr buf, + const char *user_cp, int flags); bstr mp_charset_guess_and_conv_to_utf8(struct mp_log *log, bstr buf, const char *user_cp, int flags); bstr mp_iconv_to_utf8(struct mp_log *log, bstr buf, const char *cp, int flags); -- cgit v1.2.3