Commit 1c352886 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

All Unicode fixes for fopen() (refs #528)

parent 8a1c45df
......@@ -420,11 +420,11 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
asprintf( &psz_path, "%s%s", j < 0 ? f_dir : *subdirs, p_fixed_name );
msg_Dbg( p_this, "autodetected subtitle: %s with priority %d", p_fixed_name, i_prio );
/* FIXME: a portable wrapper for stat() or access() would be more suited */
/* FIXME: a portable wrapper for stat() or access() would be more suited */
if( ( f = utf8_fopen( psz_path, "rt" ) ) )
{
fclose( f );
msg_Dbg( p_this, "autodetected subtitle: %s with priority %d", p_fixed_name, i_prio );
msg_Dbg( p_this, "autodetected subtitle: %s with priority %d", p_fixed_name, i_prio );
result[i_sub_count].priority = i_prio;
result[i_sub_count].psz_fname = psz_path;
result[i_sub_count].psz_ext = strdup(tmp_fname_ext);
......
......@@ -34,6 +34,7 @@
#include <vlc/decoder.h>
#include <vlc_filter.h>
#include <vlc_image.h>
#include <charset.h>
static picture_t *ImageRead( image_handler_t *, block_t *,
video_format_t *, video_format_t * );
......@@ -206,7 +207,7 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
FILE *file;
int i_size;
file = fopen( psz_url, "rb" );
file = utf8_fopen( psz_url, "rb" );
if( !file )
{
msg_Dbg( p_image->p_parent, "could not open file %s for reading",
......@@ -344,7 +345,7 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
p_fmt_out->i_chroma = Ext2Fourcc( psz_url );
}
file = fopen( psz_url, "wb" );
file = utf8_fopen( psz_url, "wb" );
if( !file )
{
msg_Dbg( p_image->p_parent, "could not open file %s for writing",
......
......@@ -1625,7 +1625,7 @@ static void CacheLoad( vlc_object_t *p_this )
msg_Dbg( p_this, "loading plugins cache file %s", psz_filename );
file = fopen( psz_filename, "rb" );
file = utf8_fopen( psz_filename, "rb" );
if( !file )
{
msg_Warn( p_this, "could not open plugins cache file %s for reading",
......@@ -1947,7 +1947,7 @@ static void CacheSave( vlc_object_t *p_this )
strcat( psz_filename, "/CACHEDIR.TAG" );
file = fopen( psz_filename, "wb" );
file = utf8_fopen( psz_filename, "wb" );
if( file )
{
fwrite( psz_tag, 1, strlen(psz_tag), file );
......@@ -1959,7 +1959,7 @@ static void CacheSave( vlc_object_t *p_this )
msg_Dbg( p_this, "saving plugins cache file %s", psz_filename );
file = fopen( psz_filename, "wb" );
file = utf8_fopen( psz_filename, "wb" );
if( !file )
{
msg_Warn( p_this, "could not open plugins cache file %s for writing",
......
......@@ -45,6 +45,7 @@
#include "vlc_stream.h"
#include "vlc_xml.h"
#include "vlc_interaction.h"
#include "charset.h"
/*****************************************************************************
* Misc defines
......@@ -1276,7 +1277,7 @@ void update_download_for_real( download_thread_t *p_this )
else
{
p_file = fopen( psz_dest, "w" );
p_file = utf8_fopen( psz_dest, "w" );
if( !p_file )
{
msg_Err( p_vlc, "Failed to open %s for writing", psz_dest );
......
......@@ -43,6 +43,7 @@
#include "vlc_vlm.h"
#include "vlc_vod.h"
#include "charset.h"
#define FREE( p ) \
if( p ) { free( p ); (p) = NULL; }
......@@ -194,7 +195,7 @@ int vlm_Save( vlm_t *p_vlm, const char *psz_file )
if( !p_vlm || !psz_file ) return 1;
file = fopen( psz_file, "wt" );
file = utf8_fopen( psz_file, "wt" );
if( file == NULL ) return 1;
psz_save = Save( p_vlm );
......@@ -221,7 +222,7 @@ int vlm_Load( vlm_t *p_vlm, const char *psz_file )
if( !p_vlm || !psz_file ) return 1;
file = fopen( psz_file, "r" );
file = utf8_fopen( psz_file, "r" );
if( file == NULL ) return 1;
if( fseek( file, 0, SEEK_END) != 0 )
......
......@@ -34,6 +34,7 @@
#include <errno.h>
#include "network.h"
#include "charset.h"
/* FIXME: rwlock on acl, but libvlc doesn't implement rwlock */
typedef struct vlc_acl_entry_t
......@@ -268,7 +269,7 @@ int ACL_LoadFile( vlc_acl_t *p_acl, const char *psz_path )
if( p_acl == NULL )
return -1;
file = fopen( psz_path, "r" );
file = utf8_fopen( psz_path, "r" );
if( file == NULL )
return -1;
......
This diff is collapsed.
......@@ -31,6 +31,7 @@
#include <vlc/input.h>
#include "vlc_playlist.h"
#include "charset.h"
#define PLAYLIST_FILE_HEADER "# vlc playlist file version 0.5"
......@@ -126,7 +127,7 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename ,
msg_Err( p_playlist, "out of memory");
return VLC_ENOMEM;
}
p_export->p_file = fopen( psz_filename, "wt" );
p_export->p_file = utf8_fopen( psz_filename, "wt" );
if( !p_export->p_file )
{
msg_Err( p_playlist , "could not create playlist file %s"
......
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