Commit 3cc8c40d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

* M3U: make sure strings are UTF8

 * old: convert
parent 9f1f7af1
......@@ -199,9 +199,13 @@ static int Demux( demux_t *p_demux )
b_cleanup = VLC_TRUE;
if( !psz_mrl ) goto error;
EnsureUTF8( psz_name );
EnsureUTF8( psz_mrl );
p_item = playlist_ItemNew( p_playlist, psz_mrl, psz_name );
for( i = 0; i< i_options; i++ )
{
EnsureUTF8( ppsz_options[i] );
playlist_ItemAddOption( p_item, ppsz_options[i] );
}
p_item->input.i_duration = i_duration;
......
......@@ -77,6 +77,8 @@ static int Demux( demux_t *p_demux)
p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE;
while( ( psz_line = stream_ReadLine( p_demux->s) ) != NULL )
{
char *psz_unicode;
if( ( psz_line[0] == '#' ) || (psz_line[0] == '\r') ||
( psz_line[0] == '\n') || (psz_line[0] == (char)0) )
{
......@@ -90,10 +92,13 @@ static int Demux( demux_t *p_demux)
if( psz_line[strlen(psz_line) - 1 ] == '\r' )
psz_line[strlen(psz_line) - 1 ] = (char)0;
}
playlist_Add( p_playlist, psz_line, psz_line, PLAYLIST_APPEND,
psz_unicode = FromLocale( psz_line );
playlist_Add( p_playlist, psz_unicode, psz_unicode, PLAYLIST_APPEND,
PLAYLIST_END );
free( psz_line );
LocaleFree( psz_line );
}
p_demux->b_die = VLC_TRUE;
......
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