]>
Commit | Line | Data |
---|---|---|
938b2c3a JB |
1 | --- a2ps-4.15.4/src/main.c.orig 2023-06-11 20:01:18.534593494 +0200 |
2 | +++ a2ps-4.15.4/src/main.c 2023-06-11 20:02:16.417613248 +0200 | |
3 | @@ -25,6 +25,7 @@ | |
4 | #include <config.h> | |
5 | ||
6 | #include <signal.h> | |
9d216bc5 | 7 | +#include <string.h> |
938b2c3a | 8 | #include <locale.h> |
9d216bc5 | 9 | |
10 | #include "a2ps.h" | |
938b2c3a | 11 | @@ -917,6 +918,7 @@ int |
9d216bc5 | 12 | main (int argc, char *argv[]) |
13 | { | |
14 | int argn; | |
15 | + char *locale; | |
16 | ||
938b2c3a JB |
17 | /* Name under which this program was called. */ |
18 | program_name = base_name (argv[0]); | |
19 | @@ -928,6 +930,8 @@ main (int argc, char *argv[]) | |
9d216bc5 | 20 | setlocale (LC_CTYPE, ""); |
21 | setlocale (LC_PAPER, ""); | |
22 | ||
23 | + locale = setlocale (LC_ALL, ""); | |
9d216bc5 | 24 | + |
25 | bindtextdomain (PACKAGE, LOCALEDIR); | |
938b2c3a | 26 | bindtextdomain (PACKAGE "-gnulib", LOCALEDIR); |
9d216bc5 | 27 | textdomain (PACKAGE); |
938b2c3a | 28 | @@ -988,6 +992,10 @@ main (int argc, char *argv[]) |
9d216bc5 | 29 | sheets_map = sheets_map_new (); |
30 | style_sheets = new_style_sheets (); | |
938b2c3a | 31 | |
9d216bc5 | 32 | + /* Process special case: Japanese Document */ |
0a72057e | 33 | + if ((locale != NULL) && ! strncmp (locale, "ja", 2) ) |
9d216bc5 | 34 | + job->requested_encoding_name = xstrdup ("euc-jp"); |
938b2c3a | 35 | + |
9d216bc5 | 36 | /* Process the command line options. */ |
37 | argn = a2ps_handle_options (job, argc, argv); | |
938b2c3a | 38 | switch (behavior) { |