Commit 921de760 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Further fopen() unicode fixes (refs #528)

skins2 and galaktos remain as I'm not sure how they (don't?) handle
encodings.

http interface URL were purposedly not made to use Unicode. I'm open to
suggestions on that one.
parent 543574fd
......@@ -121,7 +121,7 @@ static int Open( vlc_object_t * p_this )
msg_Info( p_demux, "dumping raw stream to standard output" );
p_sys->p_file = stdout;
}
else if( ( p_sys->p_file = fopen( p_sys->psz_file, psz_mode ) ) == NULL )
else if( ( p_sys->p_file = utf8_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
{
msg_Err( p_demux, "cannot create `%s' for writing", p_sys->psz_file );
......
......@@ -455,7 +455,7 @@ static int Open( vlc_object_t *p_this )
msg_Info( p_demux, "dumping raw stream to standard output" );
p_sys->p_file = stdout;
}
else if( ( p_sys->p_file = fopen( p_sys->psz_file, psz_mode ) ) == NULL )
else if( ( p_sys->p_file = utf8_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
{
msg_Err( p_demux, "cannot create `%s' for writing", p_sys->psz_file );
p_sys->b_file_out = VLC_FALSE;
......
......@@ -177,21 +177,20 @@ static int Open ( vlc_object_t *p_this )
}
}
psz_vobname = ToLocale( p_demux->psz_path );
psz_vobname = strdup( p_demux->psz_path );
i_len = strlen( psz_vobname );
strcpy( psz_vobname + i_len - 4, ".sub" );
memcpy( psz_vobname + i_len - 4, ".sub" );
/* open file */
if( !( p_sys->p_vobsub_file = fopen( psz_vobname, "rb" ) ) )
p_sys->p_vobsub_file = utf8_fopen( psz_vobname, "rb" );
free( psz_vobname );
if( p_sys->p_vobsub_file == NULL )
{
msg_Err( p_demux, "couldn't open .sub Vobsub file: %s",
psz_vobname );
free( p_sys );
LocaleFree( psz_vobname );
return VLC_EGENERIC;
}
LocaleFree( psz_vobname );
return VLC_SUCCESS;
}
......
......@@ -236,7 +236,7 @@ static int Open( vlc_object_t *p_this )
/* Open the log file and remove any buffering for the stream */
msg_Dbg( p_intf, "opening logfile `%s'", psz_file );
p_intf->p_sys->p_file = fopen( psz_file, "wt" );
p_intf->p_sys->p_file = utf8_fopen( psz_file, "wt" );
if( p_intf->p_sys->p_file == NULL )
{
msg_Err( p_intf, "error opening logfile `%s'", psz_file );
......@@ -274,7 +274,7 @@ static int Open( vlc_object_t *p_this )
psz_rrd_file = config_GetPsz( p_intf, "rrd-file" );
if( psz_rrd_file && *psz_rrd_file )
{
p_intf->p_sys->p_rrd = fopen( psz_rrd_file, "w" );
p_intf->p_sys->p_rrd = utf8_fopen( psz_rrd_file, "w" );
}
p_intf->p_sys->p_sub = msg_Subscribe( p_intf , MSG_QUEUE_NORMAL );
......
......@@ -1354,7 +1354,7 @@ static int FileSetup( sout_stream_t *p_stream )
sout_stream_sys_t *p_sys = p_stream->p_sys;
FILE *f;
if( ( f = fopen( p_sys->psz_sdp_file, "wt" ) ) == NULL )
if( ( f = utf8_fopen( p_sys->psz_sdp_file, "wt" ) ) == NULL )
{
msg_Err( p_stream, "cannot open file '%s' (%s)",
p_sys->psz_sdp_file, strerror(errno) );
......
......@@ -585,7 +585,7 @@ static int UnpackFromFile( sout_stream_t *p_stream, const char *psz_file,
picture_t *p_pic )
{
int i, j;
FILE *p_file = fopen( psz_file, "r" );
FILE *p_file = utf8_fopen( psz_file, "r" );
if ( p_file == NULL )
{
......
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