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

[mgp-users 01229] [resent] [patch] add locale support in mgp2ps



Hi,

this patch didn't made its way to the 1.10a version.

This patch is needed to make mgp2ps locale aware as mgp can be when compiled
with ./configure --enable-locale . This permits mgp2ps to cut words as mgp
does. This is particularly important with french words that begin/end with
an accent to not have a single lettre alone at the end/beginning of a line
which isn't correct in french.

Patch applies and works OK on the 1.10a version.

Regards,

Denis.
--- Begin Message ---
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];
 

--- End Message ---