for( size_t i = 0; i < paths.GetCount(); i++ )
{
- char *psz_utf8 = FromUTF32( paths[i].wc_str() );
+ char *psz_utf8 = wxFromLocale( paths[i] );
if( event.GetInt() )
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO),
else
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND, PLAYLIST_END );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
}
}
if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK )
{
wxString path = p_dir_dialog->GetPath();
- char *psz_utf8 = FromUTF32( path.wc_str() );
+ char *psz_utf8 = wxFromLocale( path );
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0),
PLAYLIST_END );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
}
vlc_object_release( p_playlist );
for( size_t i = 0; i < filenames.GetCount(); i++ )
{
- char *psz_utf8 = FromUTF32( filenames[i].wc_str() );
+ char *psz_utf8 = wxFromLocale( filenames[i] );
playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO),
PLAYLIST_END );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
}
vlc_object_release( p_playlist );
playlist_item_t *p_item;
char *psz_utf8;
- psz_utf8 = FromUTF32( mrl[i].wc_str() );
+ psz_utf8 = wxFromLocale( mrl[i] );
p_item = playlist_ItemNew( p_intf, psz_utf8, psz_utf8 );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
/* Insert options */
while( i + 1 < (int)mrl.GetCount() &&
- ((const char *)mrl[i + 1].wc_str())[0] == ':' )
+ ((const char *)mrl[i + 1].mb_str())[0] == ':' )
{
- psz_utf8 = FromUTF32( mrl[i + 1].wc_str() );
+ psz_utf8 = wxFromLocale( mrl[i + 1] );
playlist_ItemAddOption( p_item, psz_utf8 );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
i++;
}
{
for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ )
{
- psz_utf8 = FromUTF32( subsfile_mrl[j].wc_str() );
+ psz_utf8 = wxFromLocale( subsfile_mrl[j] );
playlist_ItemAddOption( p_item, psz_utf8 );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
}
}
{
for( int j = 0; j < (int)sout_mrl.GetCount(); j++ )
{
- psz_utf8 = FromUTF32( sout_mrl[j].wc_str() );
+ psz_utf8 = wxFromLocale( sout_mrl[j] );
playlist_ItemAddOption( p_item, psz_utf8 );
- free( psz_utf8 );
+ wxLocaleFree( psz_utf8 );
}
}
#include <list>
-#define wxUSE_UNICODE 1
#include <wx/wxprec.h>
#include <wx/wx.h>
/* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
#if defined( ENABLE_NLS )
+#if wxUSE_UNICODE
# define wxU(utf8) wxString(utf8, wxConvUTF8)
+#else
+# define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
+#endif
#else // ENABLE_NLS
+#if wxUSE_UNICODE
# define wxU(ansi) wxString(ansi, wxConvLocal)
+#else
+# define wxU(ansi) (ansi)
+#endif
#endif
/* wxL2U (locale to unicode) is used to convert ansi strings to unicode
* strings (wchar_t) */
#define wxL2U(ansi) wxU(ansi)
+#if wxUSE_UNICODE
+# define wxFromLocale(wxstring) FromUTF32(wxstring.wc_str())
+# define wxLocaleFree(string) free(string)
+#else
+# define wxFromLocale(wxstring) FromLocale(wxstring.mb_str())
+# define wxLocaleFree(string) LocaleFree(string)
+#endif
+
#define WRAPCOUNT 80
#define OPEN_NORMAL 0