]> git.sesse.net Git - vlc/commitdiff
* Use run-time detection of UTF-8 as current charset instead of hard-coding to be...
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 11 Mar 2006 19:35:22 +0000 (19:35 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 11 Mar 2006 19:35:22 +0000 (19:35 +0000)
 * Use CP1252 as a fallback instead of ISO-8859-1 (as far as printable characters are concerned, the first is a superset of the second, and it is the most commonly used charset in the west to date)

modules/codec/subsdec.c

index 4298823db9cfe7881af0907f2fda8b87cf4183b2..6d98747a6c8a162af001a7e7e4a1db958fe4be45 100644 (file)
@@ -181,12 +181,19 @@ static int OpenDecoder( vlc_object_t *p_this )
         if( !strcmp( val.psz_string, DEFAULT_NAME ) )
         {
             char *psz_charset;
-#ifdef __APPLE__
-            /* Most subtitles are not in UTF-8, which is the default on Mac OS X */
-            psz_charset = strdup( "ISO-8859-1" );
-#else
-            vlc_current_charset( &psz_charset );
-#endif
+
+            if( vlc_current_charset( &psz_charset ) )
+            {
+                /*
+                 * Most subtitles are not in UTF-8.
+                 * FIXME: This is western-centric. We should use a fallback
+                 * charset depending on the locale language instead.
+                 */
+                if( psz_charset != NULL)
+                    free( psz_charset );
+                psz_charset = strdup( "CP1252" );
+            }
+
             if( psz_charset == NULL )
             {
                 free( p_sys );