--- a2ps-4.15.4/src/main.c.orig 2023-06-11 20:01:18.534593494 +0200 +++ a2ps-4.15.4/src/main.c 2023-06-11 20:02:16.417613248 +0200 @@ -25,6 +25,7 @@ #include #include +#include #include #include "a2ps.h" @@ -917,6 +918,7 @@ int 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,8 @@ main (int argc, char *argv[]) setlocale (LC_CTYPE, ""); setlocale (LC_PAPER, ""); + locale = setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); bindtextdomain (PACKAGE "-gnulib", LOCALEDIR); textdomain (PACKAGE); @@ -988,6 +992,10 @@ main (int argc, char *argv[]) sheets_map = sheets_map_new (); style_sheets = new_style_sheets (); + /* Process special case: Japanese Document */ + if ((locale != NULL) && ! 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) {