]> git.sesse.net Git - vlc/blobdiff - modules/access/zip/zipstream.c
Revert "zip access: fix #2467. Now it's able to open files with non ASCII names,...
[vlc] / modules / access / zip / zipstream.c
index 940d5f499201c31ffccb13620b9af198d501b690..c29d11f064c9516c713bb236eae76037f7ef67bd 100644 (file)
@@ -488,8 +488,8 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
     /* Root node */
     node *playlist = new_node( psz_zip );
 
-    /* Web-Encode the URI and append '|' */
-    char *psz_pathtozip = make_URI( psz_zippath );
+    /* Web-Encode the URI and append '!' */
+    char *psz_pathtozip = vlc_UrlEncode( psz_zippath );
     if( astrcatf( &psz_pathtozip, ZIP_SEP ) < 0 ) return -1;
 
     int i_track = 0;
@@ -516,6 +516,11 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
             char *psz_path = strdup( psz_pathtozip );
             if( astrcatf( &psz_path, psz_name ) < 0 ) return -1;
 
+            /* Double url-encode */
+            char *psz_tmp = psz_path;
+            psz_path = vlc_UrlEncode( psz_tmp );
+            free( psz_tmp );
+
             /* Track information */
             if( astrcatf( pp_buffer,
                         "  <track>\n"
@@ -567,6 +572,8 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
     /* Close extension and playlist */
     if( astrcatf( pp_buffer, " </extension>\n</playlist>\n" ) < 0 ) return -1;
 
+    /* printf( "%s", *pp_buffer ); */
+
     free_all_node( playlist );
 
     return VLC_SUCCESS;