Commit 311af61b authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Rémi Denis-Courmont

subsdec: check UTF-8 autodetection if encoding is not known in ES format

This enables to show UTF-8 subtitles even though subsdec-encoding is set to
a non-UTF-8 value.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 75f2a236
......@@ -262,6 +262,7 @@ static int OpenDecoder( vlc_object_t *p_this )
encoding);
}
else
{
/* Second, try configured encoding */
if ((var = var_InheritString (p_dec, "subsdec-encoding")) != NULL)
{
......@@ -277,7 +278,7 @@ static int OpenDecoder( vlc_object_t *p_this )
encoding = var;
}
else
/* Third, try "local" encoding with optional UTF-8 autodetection */
/* Third, try "local" encoding */
{
/* xgettext:
The Windows ANSI code page most commonly used for this language.
......@@ -291,6 +292,9 @@ static int OpenDecoder( vlc_object_t *p_this )
the VideoLAN translators mailing list. */
encoding = vlc_pgettext("GetACP", "CP1252");
msg_Dbg (p_dec, "trying default character encoding: %s", encoding);
}
/* Check UTF-8 autodetection */
if (var_InheritBool (p_dec, "subsdec-autodetect-utf8"))
{
msg_Dbg (p_dec, "using automatic UTF-8 detection");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment