2b6473
diff -ruN paps-0.6.6.orig/src/libpaps.c paps-0.6.6/src/libpaps.c
2b6473
--- paps-0.6.6.orig/src/libpaps.c	2007-03-27 20:25:00.000000000 +0900
2b6473
+++ paps-0.6.6/src/libpaps.c	2007-03-27 20:31:15.000000000 +0900
2b6473
@@ -28,6 +28,7 @@
2b6473
 #include <freetype/ftglyph.h>
2b6473
 #include <freetype/ftoutln.h>
2b6473
 #include <errno.h>
2b6473
+#include <locale.h>
2b6473
 #include <stdlib.h>
2b6473
 #include <stdio.h>
2b6473
 #include <string.h>
2b6473
@@ -263,7 +264,7 @@
2b6473
 			 );
2b6473
   
2b6473
   /* Outline support */
2b6473
-  g_string_append_printf(paps->header,
2b6473
+  paps_string_append_printf(paps->header,
2b6473
 			 "/conicto {\n"
2b6473
 			 "    /to_y exch def\n"
2b6473
 			 "    /to_x exch def\n"
2b6473
@@ -691,3 +692,28 @@
2b6473
   return points * 1.0 / 72 * PAPS_DPI * PANGO_SCALE;
2b6473
 }
2b6473
 
2b6473
+void
2b6473
+paps_string_append_printf(GString *string,
2b6473
+			  const gchar *fmt,
2b6473
+			  ...)
2b6473
+{
2b6473
+	gchar *buffer, *lc_numeric;
2b6473
+	gint length;
2b6473
+	va_list args;
2b6473
+
2b6473
+	va_start(args, fmt);
2b6473
+
2b6473
+	lc_numeric = g_strdup(setlocale(LC_NUMERIC, NULL));
2b6473
+	setlocale(LC_NUMERIC, "C");
2b6473
+
2b6473
+	length = g_vasprintf(&buffer, fmt, args);
2b6473
+	g_string_append_len(string, buffer, length);
2b6473
+
2b6473
+	setlocale(LC_NUMERIC, lc_numeric);
2b6473
+
2b6473
+	g_free(buffer);
2b6473
+	g_free(lc_numeric);
2b6473
+
2b6473
+	va_end(args);
2b6473
+}
2b6473
+
2b6473
diff -ruN paps-0.6.6.orig/src/libpaps.h paps-0.6.6/src/libpaps.h
2b6473
--- paps-0.6.6.orig/src/libpaps.h	2007-03-27 20:25:00.000000000 +0900
2b6473
+++ paps-0.6.6/src/libpaps.h	2007-03-27 20:31:02.000000000 +0900
2b6473
@@ -124,4 +124,8 @@
2b6473
  */
2b6473
 double paps_postscript_points_to_pango(double points);
2b6473
 
2b6473
+void paps_string_append_printf(GString *string,
2b6473
+			       const gchar *fmt,
2b6473
+			       ...) G_GNUC_PRINTF (2, 3);
2b6473
+
2b6473
 #endif /* LIBPAPS */
2b6473
diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c
2b6473
--- paps-0.6.6.orig/src/paps.c	2007-03-27 20:25:00.000000000 +0900
2b6473
+++ paps-0.6.6/src/paps.c	2007-03-27 20:31:33.000000000 +0900
2b6473
@@ -992,7 +992,7 @@
2b6473
   y_top = page_layout->page_height - page_layout->top_margin - page_layout->header_height - page_layout->header_sep / 2;
2b6473
   y_bot = page_layout->bottom_margin - page_layout->footer_height;
2b6473
 
2b6473
-  g_string_append_printf(ps_pages_string,
2b6473
+  paps_string_append_printf(ps_pages_string,
2b6473
                          "%f %f moveto %f %f lineto 0 setlinewidth stroke\n",
2b6473
                          x_pos, y_top,
2b6473
                          x_pos, y_bot);
2b6473
@@ -1154,7 +1154,7 @@
2b6473
 
2b6473
   /* header separator */
2b6473
   line_pos = page_layout->page_height - page_layout->top_margin - page_layout->header_height - page_layout->header_sep / 2;
2b6473
-  g_string_append_printf(ps_pages_string,
2b6473
+  paps_string_append_printf(ps_pages_string,
2b6473
                          "%d %f moveto %d %f lineto 0 setlinewidth stroke\n",
2b6473
                          page_layout->left_margin, line_pos,
2b6473
                          page_layout->page_width - page_layout->right_margin, line_pos);