static subpicture_t *ParseText ( decoder_t *, block_t * );
static void StripTags ( char * );
-#define DEFAULT_NAME "System Default"
+#define DEFAULT_NAME "Default"
/*****************************************************************************
* Module descriptor.
var_Get( p_dec, "subsdec-encoding", &val );
if( !strcmp( val.psz_string, DEFAULT_NAME ) )
{
- char *psz_charset =(char*)malloc( 100 );
- vlc_current_charset( &psz_charset );
- p_sys->iconv_handle = vlc_iconv_open( "UTF-8", psz_charset );
- msg_Dbg( p_dec, "using character encoding: %s", psz_charset );
- free( psz_charset );
+ p_sys->iconv_handle = vlc_iconv_open( "UTF-8", "ISO-8859-1" );
+ msg_Dbg( p_dec, "using default character encoding: %s", "ISO-8859-1" );
}
else if( val.psz_string )
{
/* Open the converter if we need it */
if( psz_encoding != NULL )
{
+ input_thread_t *p_input;
msg_Dbg( s, "%s BOM detected", psz_encoding );
if( s->i_char_width > 1 )
{
{
msg_Err( s, "iconv_open failed" );
}
+ var_Create( s->p_parent->p_parent, "subsdec-encoding", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_SetString( s->p_parent->p_parent, "subsdec-encoding", "UTF-8" );
+ }
+ p_input = (input_thread_t *)vlc_object_find( s, VLC_OBJECT_INPUT, FIND_PARENT );
+ if( p_input != NULL)
+ {
+ var_Create( p_input, "subsdec-encoding", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_SetString( p_input, "subsdec-encoding", "UTF-8" );
+ vlc_object_release( p_input );
}
if( psz_encoding ) free( psz_encoding );
}