Commit 6ef8ef2a authored by Christophe Massiot's avatar Christophe Massiot

* include/network.h: Fixed vlc_UrlEncode with non-ASCII characters.

parent 329ae64c
...@@ -231,10 +231,10 @@ static inline char *vlc_UrlEncode( const char *psz_url ) ...@@ -231,10 +231,10 @@ static inline char *vlc_UrlEncode( const char *psz_url )
out = psz_enc; out = psz_enc;
for( in = psz_url; *in; in++ ) for( in = psz_url; *in; in++ )
{ {
char c = *in; unsigned char c = *(unsigned char *)in;
if( ( c <= 32 ) || ( c == '%' ) || ( c == '?' ) || ( c == '&' ) if( ( c <= 32 ) || ( c == '%' ) || ( c == '?' ) || ( c == '&' )
|| ( c == '+' ) ) || ( c == '+' ) || ( c >= 128 ) )
{ {
*out++ = '%'; *out++ = '%';
*out++ = ( ( c >> 4 ) >= 0xA ) ? 'A' + ( c >> 4 ) - 0xA *out++ = ( ( c >> 4 ) >= 0xA ) ? 'A' + ( c >> 4 ) - 0xA
...@@ -243,7 +243,7 @@ static inline char *vlc_UrlEncode( const char *psz_url ) ...@@ -243,7 +243,7 @@ static inline char *vlc_UrlEncode( const char *psz_url )
: '0' + ( c & 0xf ); : '0' + ( c & 0xf );
} }
else else
*out++ = c; *out++ = (char)c;
} }
*out++ = '\0'; *out++ = '\0';
......
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