diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/charset_conv.c | 7 | ||||
-rw-r--r-- | misc/charset_conv.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/misc/charset_conv.c b/misc/charset_conv.c index 3e7e47cc58..8181b1392e 100644 --- a/misc/charset_conv.c +++ b/misc/charset_conv.c @@ -52,6 +52,13 @@ bool mp_charset_is_utf8(const char *user_cp) strcasecmp(user_cp, "utf-8") == 0); } +bool mp_charset_is_utf16(const char *user_cp) +{ + bstr s = bstr0(user_cp); + return bstr_case_startswith(s, bstr0("utf16")) || + bstr_case_startswith(s, bstr0("utf-16")); +} + // Split the string on ':' into components. // out_arr is at least max entries long. // Return number of out_arr entries filled. diff --git a/misc/charset_conv.h b/misc/charset_conv.h index 3d3520fb2b..ddfabbe49e 100644 --- a/misc/charset_conv.h +++ b/misc/charset_conv.h @@ -13,6 +13,7 @@ enum { }; bool mp_charset_is_utf8(const char *user_cp); +bool mp_charset_is_utf16(const char *user_cp); bool mp_charset_requires_guess(const char *user_cp); const char *mp_charset_guess(void *talloc_ctx, struct mp_log *log, bstr buf, const char *user_cp, int flags); |