Commit 94d5831b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

* Use run-time detection of UTF-8 as current charset instead of hard-coding...

 * Use run-time detection of UTF-8 as current charset instead of hard-coding to be if and only if Mac OS X
 * 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)
parent 711b342d
......@@ -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 );
......
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