Blame SOURCES/a2ps-4.13-autoenc.patch

f97431
--- a2ps-4.13.rh/src/main.c	Fri Feb 23 17:39:02 2001
f97431
+++ a2ps-4.13.euc/src/main.c	Fri Feb 23 23:07:40 2001
f97431
@@ -31,6 +31,8 @@
f97431
 /*                                                                      */
f97431
 /************************************************************************/
f97431
 #include <assert.h>
f97431
+#include <string.h>
f97431
+#include <locale.h>
f97431
 
f97431
 #include "a2ps.h"
f97431
 #include "argmatch.h"
f97431
@@ -925,6 +927,7 @@
f97431
 main (int argc, char *argv[])
f97431
 {
f97431
   int argn;
f97431
+  char *locale;
f97431
 
f97431
   /* Architecture specific initialization. */
f97431
 #ifdef __EMX__
f97431
@@ -947,6 +950,9 @@
f97431
   setlocale (LC_CTYPE, "");
f97431
   setlocale (LC_PAPER, "");
f97431
 
f97431
+  locale = setlocale (LC_ALL, "");
f97431
+  /* fprintf(stderr, "locale : %s\n", locale); */
f97431
+
f97431
   bindtextdomain (PACKAGE, LOCALEDIR);
f97431
   textdomain (PACKAGE);
f97431
 
f97431
@@ -1013,6 +1019,10 @@
f97431
      yet read sheets. */
f97431
   sheets_map = sheets_map_new ();
f97431
   style_sheets = new_style_sheets ();
f97431
+
f97431
+  /* Process special case: Japanese Document */
f97431
+  if (! strncmp (locale, "ja", 2) )
f97431
+    job->requested_encoding_name = xstrdup ("euc-jp");
f97431
 
f97431
   /* Process the command line options. */
f97431
   argn = a2ps_handle_options (job, argc, argv);