mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-15 21:08:29 +01:00
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:
committed by
Tor Lillqvist
parent
80546e4e29
commit
f5de060304
@@ -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 ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user