diff options
author | wm4 <wm4@nowhere> | 2013-12-17 02:39:45 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-17 02:39:45 +0100 |
commit | 0112143fdaae0a6264d9e02355e9dc0ca4f7741c (patch) | |
tree | bbbe9527d1e1490e37b67d97398c5bc19c7794cd /misc/charset_conv.h | |
parent | 73a5417950a2d21a397597c05521725f3d125993 (diff) | |
download | mpv-0112143fdaae0a6264d9e02355e9dc0ca4f7741c.tar.bz2 mpv-0112143fdaae0a6264d9e02355e9dc0ca4f7741c.tar.xz |
Split mpvcore/ into common/, misc/, bstr/
Diffstat (limited to 'misc/charset_conv.h')
-rw-r--r-- | misc/charset_conv.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/misc/charset_conv.h b/misc/charset_conv.h new file mode 100644 index 0000000000..c216ede2be --- /dev/null +++ b/misc/charset_conv.h @@ -0,0 +1,19 @@ +#ifndef MP_CHARSET_CONV_H +#define MP_CHARSET_CONV_H + +#include <stdbool.h> +#include "bstr/bstr.h" + +enum { + MP_ICONV_VERBOSE = 1, // print errors instead of failing silently + MP_ICONV_ALLOW_CUTOFF = 2, // allow partial input data + MP_STRICT_UTF8 = 4, // don't fall back to UTF-8-BROKEN when guessing +}; + +bool mp_charset_is_utf8(const char *user_cp); +bool mp_charset_requires_guess(const char *user_cp); +const char *mp_charset_guess(bstr buf, const char *user_cp, int flags); +bstr mp_charset_guess_and_conv_to_utf8(bstr buf, const char *user_cp, int flags); +bstr mp_iconv_to_utf8(bstr buf, const char *cp, int flags); + +#endif |