moo_filename_from_locale()

master
Yevgen Muntyan 2006-07-05 14:16:47 -05:00
parent f8c9cb338c
commit 39628f23f6
2 changed files with 13 additions and 5 deletions

View File

@ -339,21 +339,28 @@ moo_filenames_from_locale (char **files)
for (i = 0; files && *files; ++files)
{
#ifdef __WIN32__
conv[i] = g_locale_to_utf8 (*files, -1, NULL, NULL, NULL);
conv[i] = moo_filename_from_locale (*files);
if (!conv[i])
g_warning ("%s: could not convert '%s' to UTF8", G_STRLOC, *files);
else
++i;
#else
conv[i++] = g_strdup (*files);
#endif
}
return conv;
}
char *
moo_filename_from_locale (const char *file)
{
g_return_val_if_fail (file != NULL, NULL);
#ifdef __WIN32__
return g_locale_to_utf8 (file, -1, NULL, NULL, NULL);
#else
return g_strdup (file);
#endif
}
/**********************************************************************/
/* MSLU for poor

View File

@ -57,6 +57,7 @@ gboolean moo_mkdir (const char *path,
GError **error);
char **moo_filenames_from_locale (char **files);
char *moo_filename_from_locale (const char *file);
/*
* C library and WinAPI functions wrappers analogous to glib/gstdio.h