summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/gdk-pixbuf-csource.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2004-12-05 12:43:47 +0000
committerTor Lillqvist <tml@src.gnome.org>2004-12-05 12:43:47 +0000
commit6ba75ff95bbb5fc8751ba4339613378c4e19be04 (patch)
treed6c59e2a9a386ba6aed43d745c4f2dcd981f3637 /gdk-pixbuf/gdk-pixbuf-csource.c
parent9350f2c6cf632dd99ff510f769e2acfb7995e059 (diff)
downloadgdk-pixbuf-6ba75ff95bbb5fc8751ba4339613378c4e19be04.tar.gz
gdk-pixbuf-animation.c gdk-pixbuf-io.c io-xbm.c io-xpm.c
2004-12-05 Tor Lillqvist <tml@iki.fi> * gdk-pixbuf-animation.c * gdk-pixbuf-io.c * io-xbm.c * io-xpm.c * make-inline-pixbuf.c * queryloaders.c: Use gstdio wrappers. Document that file names are in the GLib file name encoding. * gdk-pixbuf-csource.c * queryloaders.c: On Windows, convert command line arguments and environment variable values from locale encoding to UTF-8. * queryloaders.c: On Windows, use wide character API when available. * Makefile.am * gdk-pixbuf-core.h * gdk-pixbuf-io.c * gdk-pixbuf-animation.h * gdk-pixbuf-animation.c: Like in GLib, for DLL ABI stability on Windows, add binary compatibility versions of functions that take file names as arguments. They use the system codepage, not GLib file name encoding (which is UTF-8 on Windows). Use #defines to make newly compiled code use the "real" functions that use the GLib file name encoding scheme.
Diffstat (limited to 'gdk-pixbuf/gdk-pixbuf-csource.c')
-rw-r--r--gdk-pixbuf/gdk-pixbuf-csource.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-csource.c b/gdk-pixbuf/gdk-pixbuf-csource.c
index 9b0a66230..4e21553d5 100644
--- a/gdk-pixbuf/gdk-pixbuf-csource.c
+++ b/gdk-pixbuf/gdk-pixbuf-csource.c
@@ -75,6 +75,7 @@ main (int argc,
{
GdkPixbuf *pixbuf;
GError *error = NULL;
+ gchar *infilename;
/* initialize glib/GdkPixbuf */
g_type_init ();
@@ -90,7 +91,13 @@ main (int argc,
return 1;
}
- pixbuf = gdk_pixbuf_new_from_file (argv[1], &error);
+#ifdef G_OS_WIN32
+ infilename = g_locale_to_utf8 (argv[1], -1, NULL, NULL, NULL);
+#else
+ infilename = argv[1];
+#endif
+
+ pixbuf = gdk_pixbuf_new_from_file (infilename, &error);
if (!pixbuf)
{
g_fprintf (stderr, "failed to load \"%s\": %s\n",
@@ -111,11 +118,20 @@ main (int argc,
while (j--)
{
+#ifdef G_OS_WIN32
+ infilename = g_locale_to_utf8 (*p, -1, NULL, NULL, NULL);
+#else
+ infilename = *p;
+#endif
+
if (!toggle)
- image_name = *p++;
+ {
+ image_name = infilename;
+ p++;
+ }
else
{
- pixbuf = gdk_pixbuf_new_from_file (*p, &error);
+ pixbuf = gdk_pixbuf_new_from_file (infilename, &error);
if (!pixbuf)
{
g_fprintf (stderr, "failed to load \"%s\": %s\n",