]> git.sesse.net Git - vlc/commitdiff
Further fopen() unicode fixes (refs #528)
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 13 Feb 2006 10:30:30 +0000 (10:30 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 13 Feb 2006 10:30:30 +0000 (10:30 +0000)
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.

modules/demux/demuxdump.c
modules/demux/ts.c
modules/demux/vobsub.c
modules/misc/logger.c
modules/stream_out/rtp.c
modules/stream_out/switcher.c

index 1c301a6305126a06e09e35e6090b543621a85dd3..a0700afbd1ffdcaeb483e47a730fe70e29526c75 100644 (file)
@@ -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 );
 
index 69bc816b8f1a1ffafc3291c4bc63cd0815b0500e..d534a57eebde11338569a8fda811c810a16b8803 100644 (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;
index 17de7904750ee0cdafcb1f64042596f0b0be2ffd..9f4afc36ae14fc178e832f73782a3569499155ce 100644 (file)
@@ -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;
 }
index 72d402d88d5724e4bac8f52dfd0e9ea93520ff05..30d44239321af5f6a4a28078f87d7a0f714db847 100644 (file)
@@ -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 );
index b22168b20f9c0ec9833c8c1cc7325db64b4e26d5..90ee6b65e0d7bae48c760c51bb6141b80eb69c7e 100644 (file)
@@ -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) );
index 586bace6754b168f4e8ebf9b8daa0b169befa5a5..bd0379c88a0d6324bca4949853c12c70aed38da2 100644 (file)
@@ -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 )
     {