summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/ptexenc/ChangeLog6
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c9
-rw-r--r--Build/source/texk/ptexenc/ptexenc/ptexenc.h1
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/ptexdir/kanji.h2
-rw-r--r--Build/source/texk/web2c/ptexdir/pdvitype.ch8
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/uptexdir/kanji.h3
8 files changed, 37 insertions, 2 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog
index f6ac1bf7989..1d316aa8691 100644
--- a/Build/source/texk/ptexenc/ChangeLog
+++ b/Build/source/texk/ptexenc/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * ptexenc/ptexenc.h, ptexenc.c: add set_prior_file_enc() in order to
+ enable -kanji option in pdvitype and updvitype.
+ (patch from TANAKA Takuji-san).
+
2011-10-07 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptexenc.c, ptexenc/ptexenc.h: Declare and export Poptr.
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index d12f3459b56..59a17cdea4d 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -25,6 +25,7 @@
static int default_kanji_enc = ENC_UTF8;
static boolean UPTEX_enabled;
+static boolean prior_file_enc = false;
#define ESC '\033'
@@ -157,6 +158,11 @@ void enable_UPTEX (boolean enable)
}
}
+void set_prior_file_enc(void)
+{
+ prior_file_enc = true;
+}
+
const_string get_enc_string(void)
{
static char buffer[20]; /* enough large space */
@@ -437,7 +443,8 @@ int putc2(int c, FILE *fp)
const int fd = fileno(fp);
int ret = c, output_enc;
- if (fp == stdout || fp == stderr) output_enc = get_terminal_enc();
+ if ((fp == stdout || fp == stderr) && !(prior_file_enc))
+ output_enc = get_terminal_enc();
else output_enc = get_file_enc();
if (num[fd] > 0) { /* multi-byte char */
diff --git a/Build/source/texk/ptexenc/ptexenc/ptexenc.h b/Build/source/texk/ptexenc/ptexenc/ptexenc.h
index 54dd63ab336..34e9092c6d1 100644
--- a/Build/source/texk/ptexenc/ptexenc/ptexenc.h
+++ b/Build/source/texk/ptexenc/ptexenc/ptexenc.h
@@ -32,6 +32,7 @@ extern PTENCDLL int infile_enc_auto;
/* enable/disable UPTEX */
extern PTENCDLL void enable_UPTEX (boolean enable);
+extern PTENCDLL void set_prior_file_enc(void);
/* get/set Kanji encoding by string */
extern PTENCDLL const_string get_enc_string(void);
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 3eb1be48e42..8357f03a578 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * kanji.h, pdvitype.ch: enable -kanji option in pdvitype.
+ (patch from TANAKA Takuji-san).
+
2011-12-19 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* ptex-base.ch, ptex.defines, kanji.[ch]: Avoid Segmentation
diff --git a/Build/source/texk/web2c/ptexdir/kanji.h b/Build/source/texk/web2c/ptexdir/kanji.h
index 1be8729cf3c..c46b712d240 100644
--- a/Build/source/texk/web2c/ptexdir/kanji.h
+++ b/Build/source/texk/web2c/ptexdir/kanji.h
@@ -37,6 +37,8 @@ extern void init_default_kanji (const_string file_str, const_string internal_str
#define initdefaultkanji() init_default_kanji(NULL, "euc")
/* for pBibTeX, pDVItype, pPLtoTF, and pTFtoPL */
#define initkanji() init_default_kanji(NULL, "euc")
+/* for pDVItype */
+#define setpriorfileenc() set_prior_file_enc()
#ifndef PRESERVE_PUTC
#undef putc
diff --git a/Build/source/texk/web2c/ptexdir/pdvitype.ch b/Build/source/texk/web2c/ptexdir/pdvitype.ch
index 7a30e85d560..4eadb69caf9 100644
--- a/Build/source/texk/web2c/ptexdir/pdvitype.ch
+++ b/Build/source/texk/web2c/ptexdir/pdvitype.ch
@@ -144,6 +144,13 @@ for k:=1 to nt do
@z
@x
+ print_ln(']');
+@y
+ print(']');
+ print_ln('');
+@z
+
+@x
@p procedure out_text(c:ASCII_code);
begin if text_ptr=line_length-2 then flush_text;
incr(text_ptr); text_buf[text_ptr]:=c;
@@ -504,6 +511,7 @@ const n_options = 10; {Pascal won't count array lengths for us.}
end; {Else it was a flag; |getopt| has already done the assignment.}
@y
end else if argument_is ('kanji') then begin
+ set_prior_file_enc;
if (not set_enc_string(optarg,optarg)) then begin
write_ln('Bad kanji encoding "', stringcast(optarg), '".');
end;
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index b8cbfe38918..68ccfe6e72c 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * kanji.h: enable -kanji option in updvitype.
+ (patch from TANAKA Takuji-san).
+
2011-12-19 Peter Breitenlohner <peb@mppmu.mpg.de>
* uptex-m.ch, kanji.[ch]: Drop unused param2 of check_kanji().
diff --git a/Build/source/texk/web2c/uptexdir/kanji.h b/Build/source/texk/web2c/uptexdir/kanji.h
index a6e92c40760..0109f772e9d 100644
--- a/Build/source/texk/web2c/uptexdir/kanji.h
+++ b/Build/source/texk/web2c/uptexdir/kanji.h
@@ -35,12 +35,13 @@ extern integer calc_pos (integer c);
extern integer kcatcodekey (integer c);
extern integer multilenbuffchar (integer c);
-extern void init_kanji (const_string file_str, const_string internal_str);
extern void init_default_kanji (const_string file_str, const_string internal_str);
/* for upTeX and e-upTeX */
#define initdefaultkanji() init_default_kanji("utf8", "uptex")
/* for upBibTeX, upDVItype, upPLtoTF, and upTFtoPL */
#define initkanji() init_default_kanji("utf8", "uptex")
+/* for upDVItype */
+#define setpriorfileenc() set_prior_file_enc()
/* number of rest of multi-char for kcode_pos */
#define nrestmultichr(x) ( (x)!=0 ? ((x) / 8) + 2 - ((x) % 8) : -1 )