[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mgp-users 01112] [patch] add locale support in mgp2ps



Hi,

Here is a trivial patch to mgp2ps to add the locale support, so ps generated
with mgp2ps has the same hyphenation than what is shown by mgp.

Regards,

Denis.
--- print.c.orig	Mon Sep 17 16:48:30 2001
+++ print.c	Thu Dec 19 20:22:12 2002
@@ -33,6 +33,11 @@
  */
 
 #include "mgp.h"
+#ifdef USE_SETLOCALE
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#endif
 
 static u_int align = AL_LEFT;
 static char *curprefix = NULL;
@@ -1906,6 +1911,10 @@
 	extern int optind;
 	char *progname;
 	static char pathbuf[MAXPATHLEN];
+
+#ifdef USE_SETLOCALE
+        setlocale(LC_CTYPE, "");
+#endif
 
 	progname = argv[0];