p_sys->iconv_from_utf8 = p_sys->iconv_to_utf8 = (vlc_iconv_t)-1;
}
- free( psz_src );
+ p_sys->psz_charset = strdup( psz_src );
+ psz_src = NULL;
/* determine file handler associations */
p_sys->i_handlers = 0;
}
httpd_HostDelete( p_sys->p_httpd_host );
free( p_sys->psz_address );
- free( p_sys->psz_html_type );
+ free( p_sys->psz_html_type );
if( p_sys->iconv_from_utf8 != (vlc_iconv_t)-1 )
vlc_iconv_close( p_sys->iconv_from_utf8 );
if( p_sys->iconv_to_utf8 != (vlc_iconv_t)-1 )
E_(mvar_AppendNewVar)( p_args->vars, "stream_length", length );
E_(mvar_AppendNewVar)( p_args->vars, "volume", volume );
E_(mvar_AppendNewVar)( p_args->vars, "stream_state", state );
+ E_(mvar_AppendNewVar)( p_args->vars, "charset", ((intf_sys_t *)p_args->p_intf->p_sys)->psz_charset );
E_(SSInit)( &p_args->stack );
char **pp_data = (char **)_pp_data;
FILE *f;
- /* FIXME: do we need character encoding translation here ? */
+ /* FIXME: do we need character encoding translation here? */
if( ( f = fopen( p_args->file, "r" ) ) == NULL )
{
Callback404( p_args, pp_data, pi_data );
if( !f->b_handler )
{
+ char *psz_type = strdup( p_sys->psz_html_type );
+ if( strstr( &dir[strlen( psz_root )], ".xml" ) )
+ {
+ char *psz = strstr( psz_type, "html;" );
+ if( psz )
+ {
+ psz[0] = 'x';
+ psz[1] = 'm';
+ psz[2] = 'l';
+ psz[3] = ';';
+ psz[4] = ' ';
+ }
+ }
f->p_file = httpd_FileNew( p_sys->p_httpd_host,
f->name,
- f->b_html ? ( strstr( &dir[strlen( psz_root )], ".xml" ) ? "text/xml; charset=UTF-8" : p_sys->psz_html_type ) :
- NULL,
+ f->b_html ? psz_type : NULL,
user, password, p_acl,
E_(HttpCallback), f );
+ free( psz_type );
if( f->p_file != NULL )
{
TAB_APPEND( p_sys->i_files, p_sys->pp_files, f );