+2004-12-12 Tor Lillqvist <tml@iki.fi>
+
+ * glib/glib.symbols
+ * glib/gconvert.[ch]: Implement Windows DLL ABI stability also for
+ g_filename_{to,from}_uri().
+
2004-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gstdio.c (g_rename, g_unlink, g_remove): Add doc comments
+2004-12-12 Tor Lillqvist <tml@iki.fi>
+
+ * glib/glib.symbols
+ * glib/gconvert.[ch]: Implement Windows DLL ABI stability also for
+ g_filename_{to,from}_uri().
+
2004-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gstdio.c (g_rename, g_unlink, g_remove): Add doc comments
+2004-12-12 Tor Lillqvist <tml@iki.fi>
+
+ * glib/glib.symbols
+ * glib/gconvert.[ch]: Implement Windows DLL ABI stability also for
+ g_filename_{to,from}_uri().
+
2004-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gstdio.c (g_rename, g_unlink, g_remove): Add doc comments
+2004-12-12 Tor Lillqvist <tml@iki.fi>
+
+ * glib/glib.symbols
+ * glib/gconvert.[ch]: Implement Windows DLL ABI stability also for
+ g_filename_{to,from}_uri().
+
2004-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gstdio.c (g_rename, g_unlink, g_remove): Add doc comments
+2004-12-12 Tor Lillqvist <tml@iki.fi>
+
+ * glib/glib.symbols
+ * glib/gconvert.[ch]: Implement Windows DLL ABI stability also for
+ g_filename_{to,from}_uri().
+
2004-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gstdio.c (g_rename, g_unlink, g_remove): Add doc comments
* subsequent character sets are used when trying to generate a displayable
* representation of a filename, see g_filename_display_name().
*
- * The character sets are determined by consulting the environment variables
- * <envar>G_FILENAME_ENCODING</envar> and <envar>G_BROKEN_FILENAMES</envar>.
+ * On Unix, the character sets are determined by consulting the
+ * environment variables <envar>G_FILENAME_ENCODING</envar> and
+ * <envar>G_BROKEN_FILENAMES</envar>. On Windows, the character set
+ * used in the GLib API is always UTF-8 and said environment variables
+ * have no effect.
*
* <envar>G_FILENAME_ENCODING</envar> may be set to a comma-separated list
* of character set names. The special token "@locale" is taken to mean the
* @error: location to store the error occuring, or %NULL to ignore
* errors. Any of the errors in #GConvertError may occur.
*
- * Converts a string which is in the encoding used for filenames
+ * Converts a string which is in the encoding used by GLib for filenames
* into a UTF-8 string.
*
* Return value: The converted string, or %NULL on an error.
return result;
}
+#ifdef G_OS_WIN32
+
+#undef g_filename_from_uri
+
+gchar *
+g_filename_from_uri (const gchar *uri,
+ gchar **hostname,
+ GError **error)
+{
+ gchar *utf8_filename;
+ gchar *retval = NULL;
+
+ utf8_filename = g_filename_from_uri_utf8 (uri, hostname, error);
+ if (utf8_filename)
+ {
+ retval = g_locale_from_utf8 (utf8_filename, -1, NULL, NULL, error);
+ g_free (utf8_filename);
+ }
+ return retval;
+}
+
+#endif
+
/**
* g_filename_to_uri:
* @filename: an absolute filename specified in the encoding
return escaped_uri;
}
+#ifdef G_OS_WIN32
+
+#undef g_filename_to_uri
+
+gchar *
+g_filename_to_uri (const gchar *filename,
+ const gchar *hostname,
+ GError **error)
+{
+ gchar *utf8_filename;
+ gchar *retval = NULL;
+
+ utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error);
+
+ if (utf8_filename)
+ {
+ retval = g_filename_to_uri_utf8 (utf8_filename, hostname, error);
+ g_free (utf8_filename);
+ }
+
+ return retval;
+}
+
+#endif
+
/**
* g_uri_list_extract_uris:
* @uri_list: an URI list
#ifdef G_OS_WIN32
#define g_filename_to_utf8 g_filename_to_utf8_utf8
#define g_filename_from_utf8 g_filename_from_utf8_utf8
+#define g_filename_from_uri g_filename_from_uri_utf8
+#define g_filename_to_uri g_filename_to_uri_utf8
#endif
gchar* g_filename_to_utf8 (const gchar *opsysstring,
g_file_get_contents_utf8
#endif
g_filename_display_name G_GNUC_MALLOC
-g_filename_from_uri G_GNUC_MALLOC
+g_filename_from_uri PRIVATE G_GNUC_MALLOC
+#ifdef G_OS_WIN32
+g_filename_from_uri_utf8 G_GNUC_MALLOC
+#endif
g_filename_from_utf8 PRIVATE G_GNUC_MALLOC
#ifdef G_OS_WIN32
g_filename_from_utf8_utf8
#endif
-g_filename_to_uri G_GNUC_MALLOC
+g_filename_to_uri PRIVATE G_GNUC_MALLOC
+#ifdef G_OS_WIN32
+g_filename_to_uri_utf8 G_GNUC_MALLOC
+#endif
g_filename_to_utf8 PRIVATE G_GNUC_MALLOC
#ifdef G_OS_WIN32
g_filename_to_utf8_utf8