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