Commit 2acf64c7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

decode_URI: do not call EnsureUTF8

This fixes opening files with non-UTF8 sequences in their path (as long
as the file:// URI is %-encoded correctly).
parent 118274b4
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <vlc_network.h> #include <vlc_network.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_sout.h> #include <vlc_sout.h>
#include <vlc_charset.h>
#ifndef IPPORT_FTP #ifndef IPPORT_FTP
# define IPPORT_FTP 21u # define IPPORT_FTP 21u
...@@ -316,6 +317,8 @@ static int parseURL( vlc_url_t *url, const char *path ) ...@@ -316,6 +317,8 @@ static int parseURL( vlc_url_t *url, const char *path )
return VLC_EGENERIC; /* ASCII and directory not supported */ return VLC_EGENERIC; /* ASCII and directory not supported */
} }
decode_URI( url->psz_path ); decode_URI( url->psz_path );
/* FIXME: check for UTF-8 support, otherwise only ASCII is allowed */
EnsureUTF8( url->psz_path );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <vlc_url.h> #include <vlc_url.h>
#include "vlc_playlist.h" #include "vlc_playlist.h"
#include "vlc_interface.h" #include "vlc_interface.h"
#include <vlc_charset.h>
#include "item.h" #include "item.h"
#include "info.h" #include "info.h"
...@@ -388,7 +389,10 @@ void input_item_SetURI( input_item_t *p_i, const char *psz_uri ) ...@@ -388,7 +389,10 @@ void input_item_SetURI( input_item_t *p_i, const char *psz_uri )
/* Make the name more readable */ /* Make the name more readable */
if( p_i->psz_name ) if( p_i->psz_name )
{
decode_URI( p_i->psz_name ); decode_URI( p_i->psz_name );
EnsureUTF8( p_i->psz_name );
}
} }
else else
{ /* Strip login and password from title */ { /* Strip login and password from title */
......
...@@ -103,10 +103,9 @@ int main (void) ...@@ -103,10 +103,9 @@ int main (void)
test_decode ("%2", "%2"); test_decode ("%2", "%2");
test_decode ("%0000", ""); test_decode ("%0000", "");
/* UTF-8 tests */ /* Non-ASCII tests */
test_decode ("T%C3%a9l%c3%A9vision+%e2%82%Ac", "Télévision €"); test_decode ("T%C3%a9l%c3%A9vision+%e2%82%Ac", "Télévision €");
test_decode ("T%E9l%E9vision", "T?l?vision"); test_decode ("T%E9l%E9vision", "T\xe9l\xe9vision");
test_decode ("%C1%94%C3%a9l%c3%A9vision", "??élévision"); /* overlong */
/* Base 64 tests */ /* Base 64 tests */
test_b64 ("", ""); test_b64 ("", "");
......
...@@ -109,7 +109,6 @@ char *decode_URI( char *psz ) ...@@ -109,7 +109,6 @@ char *decode_URI( char *psz )
} }
} }
*out = '\0'; *out = '\0';
EnsureUTF8( psz );
return psz; return psz;
} }
......
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