Argument is in UTF-8. Use wide character Win32 API if present.

2004-11-04  Tor Lillqvist  <tml@iki.fi>

	* gmodule-win32.c (_g_module_open): Argument is in UTF-8. Use wide
	character Win32 API if present.

	* gmodule.c (parse_libtool_archive, g_module_open): Convert file
	name to UTF-8 before storing in the error message string.

	* gmodule.c (parse_libtool_archive): Use g_open().
This commit is contained in:
Tor Lillqvist
2004-11-04 00:20:27 +00:00
committed by Tor Lillqvist
parent 80546e4e29
commit f5de060304
3 changed files with 37 additions and 5 deletions

View File

@@ -62,8 +62,21 @@ _g_module_open (const gchar *file_name,
cygwin_conv_to_win32_path(file_name, tmp);
file_name = tmp;
#endif
if (G_WIN32_HAVE_WIDECHAR_API ())
{
wchar_t *wfilename = g_utf8_to_utf16 (file_name, -1, NULL, NULL, NULL);
handle = LoadLibrary (file_name);
handle = LoadLibraryW (wfilename);
g_free (wfilename);
}
else
{
gchar *cp_filename = g_locale_from_utf8 (file_name, -1, NULL, NULL, NULL);
handle = LoadLibraryA (cp_filename);
g_free (cp_filename);
}
if (!handle)
set_error ();