]> Pileus Git - grits/blobdiff - src/data/grits-wms.c
Add support for GTK 3
[grits] / src / data / grits-wms.c
index 32c0c0cfa3cec96f9e336d1c60fdb9335af843d5..ccb8ce02e3a618f0380b50f8250420cd2c91a5dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
+ * Copyright (C) 2009-2011 Andy Spencer <andy753421@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <config.h>
 #include <stdio.h>
 #include <glib.h>
+#include <locale.h>
 
 #include "grits-wms.h"
 #include "grits-http.h"
 
+static gchar *g_strdup_printf_safe(char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       setlocale(LC_ALL, "POSIX.UTF-8");
+       char *str = g_strdup_vprintf(fmt, ap);
+       setlocale(LC_ALL, "");
+       va_end(ap);
+       return str;
+}
+
 static gchar *_make_uri(GritsWms *wms, GritsTile *tile)
 {
-       return g_strdup_printf(
+       return g_strdup_printf_safe(
                "%s?"
                "SERVICE=WMS&"
                "VERSION=1.1.0&"