#include <vlc_common.h>
#include <vlc_plugin.h> /* MODULE_SUFFIX */
+#include <vlc_charset.h>
#include "libvlc.h"
#include "modules.h"
#include <stdio.h> /* sprintf() */
#include <string.h> /* strdup() */
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#if !defined(HAVE_DYNAMIC_PLUGINS)
/* no support for plugins */
#elif defined(HAVE_DL_WINDOWS)
wchar_t psz_wfile[MAX_PATH];
- MultiByteToWideChar( CP_ACP, 0, psz_file, -1, psz_wfile, MAX_PATH );
+ MultiByteToWideChar( CP_UTF8, 0, psz_file, -1, psz_wfile, MAX_PATH );
#ifndef UNDER_CE
/* FIXME: this is not thread-safe -- Courmisch */
# else
const int flags = 0;
# endif
+ char *path = ToLocale( psz_file );
- handle = dlopen( psz_file, flags );
+ handle = dlopen( path, flags );
if( handle == NULL )
{
- msg_Warn( p_this, "cannot load module `%s' (%s)",
- psz_file, dlerror() );
+ msg_Warn( p_this, "cannot load module `%s' (%s)", path, dlerror() );
+ LocaleFree( path );
return -1;
}
+ LocaleFree( path );
#elif defined(HAVE_DL_SHL_LOAD)
handle = shl_load( psz_file, BIND_IMMEDIATE | BIND_NONFATAL, NULL );