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