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

mb_str() doesn't work as documented (or maybe it doesn't work at all)

so use wc_str() instead - closes #362

Now it looks almost like an exerpt from The Daily WTF :(
parent 5c77525e
......@@ -405,7 +405,7 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event )
for( size_t i = 0; i < paths.GetCount(); i++ )
{
char *psz_utf8 = FromLocale( paths[i].mb_str() );
char *psz_utf8 = FromUTF32( paths[i].wc_str() );
if( event.GetInt() )
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO),
......@@ -413,7 +413,7 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event )
else
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND, PLAYLIST_END );
LocaleFree( psz_utf8 );
free( psz_utf8 );
}
}
......@@ -436,11 +436,11 @@ void DialogsProvider::OnOpenDirectory( wxCommandEvent& event )
if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK )
{
wxString path = p_dir_dialog->GetPath();
char *psz_utf8 = FromLocale( path.mb_str() );
char *psz_utf8 = FromUTF32( path.wc_str() );
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0),
PLAYLIST_END );
LocaleFree( psz_utf8 );
free( psz_utf8 );
}
vlc_object_release( p_playlist );
......
......@@ -1373,11 +1373,11 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
for( size_t i = 0; i < filenames.GetCount(); i++ )
{
char *psz_utf8 = FromLocale( filenames[i].mb_str() );
char *psz_utf8 = FromUTF32( filenames[i].wc_str() );
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO),
PLAYLIST_END );
LocaleFree( psz_utf8 );
free( psz_utf8 );
}
vlc_object_release( p_playlist );
......
......@@ -1147,17 +1147,17 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
playlist_item_t *p_item;
char *psz_utf8;
psz_utf8 = FromLocale( mrl[i].mb_str() );
psz_utf8 = FromUTF32( mrl[i].wc_str() );
p_item = playlist_ItemNew( p_intf, psz_utf8, psz_utf8 );
LocaleFree( psz_utf8 );
free( psz_utf8 );
/* Insert options */
while( i + 1 < (int)mrl.GetCount() &&
((const char *)mrl[i + 1].mb_str())[0] == ':' )
((const char *)mrl[i + 1].wc_str())[0] == ':'L )
{
psz_utf8 = FromLocale( mrl[i + 1].mb_str() );
psz_utf8 = FromUTF32( mrl[i + 1].wc_str() );
playlist_ItemAddOption( p_item, psz_utf8 );
LocaleFree( psz_utf8 );
free( psz_utf8 );
i++;
}
......@@ -1166,9 +1166,9 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{
for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ )
{
psz_utf8 = FromLocale( subsfile_mrl[j].mb_str() );
psz_utf8 = FromUTF32( subsfile_mrl[j].wc_str() );
playlist_ItemAddOption( p_item, psz_utf8 );
LocaleFree( psz_utf8 );
free( psz_utf8 );
}
}
......@@ -1177,9 +1177,9 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{
for( int j = 0; j < (int)sout_mrl.GetCount(); j++ )
{
psz_utf8 = FromLocale( sout_mrl[j].mb_str() );
playlist_ItemAddOption( p_item, sout_mrl[j].mb_str() );
LocaleFree( psz_utf8 );
psz_utf8 = FromUTF32( sout_mrl[j].wc_str() );
playlist_ItemAddOption( p_item, psz_utf8 );
free( psz_utf8 );
}
}
......
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