diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-23 10:34:55 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-23 10:34:55 +0200 |
commit | 3d09c609a4cf987eb5adfa73c6e20151c1345a10 (patch) | |
tree | 715888f4f92028f400771b842b14349911b6b4fc /libass/ass_utils.c | |
parent | 0b0ce2cd0bd6448372b8ef7b9b6b18437d264546 (diff) | |
download | libass-3d09c609a4cf987eb5adfa73c6e20151c1345a10.tar.bz2 libass-3d09c609a4cf987eb5adfa73c6e20151c1345a10.tar.xz |
Remove ENCA support
There is no real value in it. ENCA only works in some cases and I
can't find any information about software that integrates libass
which relies on it or users that rely on ENCA support in case the
interface is exposed directly (e.g. in MPlayer).
If there is still a wish to have charset detection integrated into
libass (it is out of scope, IMHO), a better library like uchardet
should be used for that.
Diffstat (limited to 'libass/ass_utils.c')
-rw-r--r-- | libass/ass_utils.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/libass/ass_utils.c b/libass/ass_utils.c index aca511b..ab1ea02 100644 --- a/libass/ass_utils.c +++ b/libass/ass_utils.c @@ -528,47 +528,3 @@ ASS_Style *lookup_style_strict(ASS_Track *track, char *name, size_t len) return NULL; } -#ifdef CONFIG_ENCA -void *ass_guess_buffer_cp(ASS_Library *library, unsigned char *buffer, - int buflen, char *preferred_language, - char *fallback) -{ - const char **languages; - size_t langcnt; - EncaAnalyser analyser; - EncaEncoding encoding; - char *detected_sub_cp = NULL; - int i; - - languages = enca_get_languages(&langcnt); - ass_msg(library, MSGL_V, "ENCA supported languages"); - for (i = 0; i < langcnt; i++) { - ass_msg(library, MSGL_V, "lang %s", languages[i]); - } - - for (i = 0; i < langcnt; i++) { - const char *tmp; - - if (ass_strcasecmp(languages[i], preferred_language) != 0) - continue; - analyser = enca_analyser_alloc(languages[i]); - encoding = enca_analyse_const(analyser, buffer, buflen); - tmp = enca_charset_name(encoding.charset, ENCA_NAME_STYLE_ICONV); - if (tmp && encoding.charset != ENCA_CS_UNKNOWN) { - detected_sub_cp = strdup(tmp); - ass_msg(library, MSGL_INFO, "ENCA detected charset: %s", tmp); - } - enca_analyser_free(analyser); - } - - free(languages); - - if (!detected_sub_cp) { - detected_sub_cp = strdup(fallback); - ass_msg(library, MSGL_INFO, - "ENCA detection failed: fallback to %s", fallback); - } - - return detected_sub_cp; -} -#endif |