[vlc-devel] [PATCH] subsdec: check UTF-8 autodetection all the time

KO Myung-Hun komh78 at gmail.com
Sat Oct 13 14:21:36 CEST 2012


This is useful for the case that there are both the subtitles in UTF-8 and
ones in NLS.
---
 modules/codec/subsdec.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 118e901..89c048a 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -277,7 +277,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,11 +291,13 @@ 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);
-        if (var_InheritBool (p_dec, "subsdec-autodetect-utf8"))
-        {
-            msg_Dbg (p_dec, "using automatic UTF-8 detection");
-            p_sys->b_autodetect_utf8 = true;
-        }
+    }
+
+    /* Check UTF-8 autodetection */
+    if (var_InheritBool (p_dec, "subsdec-autodetect-utf8"))
+    {
+        msg_Dbg (p_dec, "using automatic UTF-8 detection");
+        p_sys->b_autodetect_utf8 = true;
     }
 
     if (strcasecmp (encoding, "UTF-8") && strcasecmp (encoding, "utf8"))
-- 
1.7.3.2




More information about the vlc-devel mailing list