diff -Nru a2ps-4.15.6_copy/src/main.c a2ps-4.15.6/src/main.c --- a2ps-4.15.6_copy/src/main.c 2025-02-28 17:01:52.916699393 +0800 +++ a2ps-4.15.6/src/main.c 2025-02-28 17:23:29.851947397 +0800 @@ -26,6 +26,7 @@ #include #include +#include #include "a2ps.h" #include "argmatch.h" @@ -917,6 +918,7 @@ main (int argc, char *argv[]) { int argn; + char *locale; /* Name under which this program was called. */ program_name = base_name (argv[0]); @@ -928,6 +930,9 @@ setlocale (LC_CTYPE, ""); setlocale (LC_PAPER, ""); + locale = setlocale (LC_ALL, ""); + /* fprintf(stderr, "locale : %s\n", locale); */ + bindtextdomain (PACKAGE, LOCALEDIR); bindtextdomain (PACKAGE "-gnulib", LOCALEDIR); textdomain (PACKAGE); @@ -988,6 +993,10 @@ 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); switch (behavior) {