/* TODO: write an internal function of this one, to avoid
* unnecessary lookups. */
- /* FIXME: should we convert options to UTF-8 as well ?? */
#ifdef WIN32
if( GetVersion() < 0x80000000 )
else
#endif
{
+ /* FIXME: it's too late to call FromLocale here. We should
+ convert ALL arguments to UTF8 before they get parsed */
+
psz_target = FromLocale( ppsz_argv[ i_opt ] );
VLC_AddTarget( p_vlc->i_object_id, psz_target,
(char const **)( i_options ? &ppsz_argv[i_opt + 1] :
#include <winsock.h>
-extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron,
- int expand_wildcards, int *startupinfo);
-
/*****************************************************************************
* system_Init: initialize winsock and misc other things.
*****************************************************************************/
/* Call mdate() once to make sure it is initialized properly */
mdate();
- /* Replace argv[1..n] with unicode for Windows NT and above */
- if( GetVersion() < 0x80000000 )
- {
- wchar_t **wargv, **wenvp;
- int i,i_wargc;
- int si = { 0 };
- __wgetmainargs(&i_wargc, &wargv, &wenvp, 0, &si);
-
- for( i = 1; i < i_wargc; i++ )
- ppsz_argv[i] = FromWide( wargv[i] );
- }
-
/* WinSock Library Init. */
if( !WSAStartup( MAKEWORD( 2, 2 ), &Data ) )
{
#include <vlc/vlc.h>
+#ifdef WIN32
+extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron,
+ int expand_wildcards, int *startupinfo);
+#endif
+
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
signal( SIGPIPE, SIG_IGN );
#endif
+#ifdef WIN32
+ /* Replace argv[1..n] with unicode for Windows NT and above */
+ if( GetVersion() < 0x80000000 )
+ {
+ wchar_t **wargv, **wenvp;
+ int i,i_wargc;
+ int si = { 0 };
+ __wgetmainargs(&i_wargc, &wargv, &wenvp, 0, &si);
+
+ for( i = 1; i < i_wargc; i++ )
+ ppsz_argv[i] = FromWide( wargv[i] );
+ }
+#endif
+
/* Initialize libvlc */
i_ret = VLC_Init( 0, i_argc, ppsz_argv );
if( i_ret < 0 )