>From 007c7a20c2a0ac5cd485904da51d4fff7c97ddac Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Sat, 13 Oct 2012 21:12:22 +0900
Subject: [PATCH 3/3] subsdec: check UTF-8 autodetection all the time

This enables to show UTF-8 subtitles even though subsdec-encoding is set to
a non-UTF-8 value.
---
 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

