summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/eptexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.defines1
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.ech55
-rw-r--r--Build/source/texk/web2c/euptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.defines1
5 files changed, 56 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog
index f7fb353f567..5d5f963409d 100644
--- a/Build/source/texk/web2c/eptexdir/ChangeLog
+++ b/Build/source/texk/web2c/eptexdir/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-09 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+ and Noriyuki Abe <abenori@math.sci.hokudai.ac.jp>
+
+ * eptex.ech: \epTeXinputencoding works also with the terminal.
+ * eptex.defines: Add a new function setstdinenc().
+
2017-09-06 Noriyuki Abe <abenori@math.sci.hokudai.ac.jp>
* eptex.ech: fix a bug in \epTeXinputencoding.
diff --git a/Build/source/texk/web2c/eptexdir/eptex.defines b/Build/source/texk/web2c/eptexdir/eptex.defines
index 8af65b6678e..e6d9a441504 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.defines
+++ b/Build/source/texk/web2c/eptexdir/eptex.defines
@@ -20,6 +20,7 @@
@define function inputline2 ();
@define function setinfileenc ();
+@define function setstdinenc ();
@define function fromJIS ();
@define function fromEUC ();
diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech
index 5702c3a4b95..af94d280aad 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.ech
+++ b/Build/source/texk/web2c/eptexdir/eptex.ech
@@ -339,18 +339,51 @@ epTeX_input_encoding_code:@<Implement \.{\\epTeXinputencoding}@>;
@x
@ @<Finish the extensions@>=
@y
-@ @<Implement \.{\\epTeXinputencoding}@>=
- begin
- scan_file_name;
- pack_cur_name;
- if setinfileenc(input_file[in_open],stringcast(name_of_file+1)) = false then
- begin
- wlog_cr;
- wlog('Unknown encoding `');
- fputs(stringcast(name_of_file + 1), log_file);
- wlog('''');
+@ @<Declare procedures needed in |do_ext...@>=
+procedure eptex_set_input_encoding;
+var j,k:integer;
+begin
+ scan_file_name;
+ pack_cur_name;
+ if state=token_list then
+ begin k:=input_ptr-1; j:=-1;
+ while k>=0 do
+ begin if input_stack[k].state_field=token_list then decr(k)
+ else if input_stack[k].name_field>19 then
+ begin j:=input_stack[k].index_field; k:=-1; end
+ else begin j:=-(name+1); k:=-1; end
+ end
end
- end
+ else if name>19 then j:=index else j:=-(name+1);
+ if (j>=0) or (j=-1) or (j=-18) then begin
+ k:=true;
+ if j>= 0 then k:=setinfileenc(input_file[j],stringcast(name_of_file+1))
+ else k:=setstdinenc(stringcast(name_of_file+1));
+ if k = false then
+ begin begin_diagnostic;
+ print_nl("Unknown encoding `");
+ case selector of
+ term_and_log: begin wterm(stringcast(name_of_file + 1));
+ wlog(stringcast(name_of_file + 1)); end;
+ log_only: wlog(stringcast(name_of_file + 1));
+ term_only: wterm(stringcast(name_of_file + 1));
+ endcases;
+ print("'"); end_diagnostic(false);
+ end
+ end
+ else
+ begin begin_diagnostic; j:=-j-1;
+ print_ln;
+ print_nl("Warning: \epTeXinputencoding is ignored, since I am current reading");
+ print_nl("from ");
+ if j>=18 then print("a pseudo file created by \scantokens.")
+ else begin print("input stream "); print_int(j); print("."); end;
+ end_diagnostic(false);
+ end
+end;
+
+@ @<Implement \.{\\epTeXinputencoding}@>=
+eptex_set_input_encoding
@ @<Finish the extensions@>=
@z
diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog
index 986e39a0758..c3b51dd825b 100644
--- a/Build/source/texk/web2c/euptexdir/ChangeLog
+++ b/Build/source/texk/web2c/euptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2017-09-09 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * euptex.defines: Add a new function setstdinenc().
+
2017-04-24 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* euptex.ch0: Adapt to changes in ptexdir/ptex-base.ch (p\TeX -> \pTeX).
diff --git a/Build/source/texk/web2c/euptexdir/euptex.defines b/Build/source/texk/web2c/euptexdir/euptex.defines
index 7f10e36304a..b2035a4af2e 100644
--- a/Build/source/texk/web2c/euptexdir/euptex.defines
+++ b/Build/source/texk/web2c/euptexdir/euptex.defines
@@ -25,6 +25,7 @@
@define function inputline2 ();
@define function setinfileenc ();
+@define function setstdinenc ();
@define function fromJIS ();
@define function fromEUC ();