From 1eff88f8256fc97ff44035cfd29e162947e4fd67 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 28 Oct 2014 18:13:43 +0000 Subject: [24.355]: deactivate enctex when reading \^^ab control sequences. (Following full description from Petr is slightly edited for English). Date: Wed, 30 Jul 2014 10:08:40 +0200 From: Petr Olsak To: Karl Berry Consider this input file: ------------------------- \catcode`\{=1 \catcode`\}=2 \catcode`^=7 \mubyte A XY\endmubyte \mubytein=1 \mubyteout=0 \mubytelog=0 \def\a{\^^58YZ \XYZ XYZ} \show\a \end ------------------------- Then run pdftex -ini -enc ./file.tex The buggy behavior is: \a=macro: ->\AZ \AZ AZ. because encTeX's conversion XY -> A have to be done *before* tokenisation as the manual says. I.e., ^^58 -> X is done *after* encTeX's level and the good result would be: \a=macro: ->\XYZ \AZ AZ. The consequence of this curious bug is the question at http://tex.stackexchange.com/questions/191002/csplain-and-url-package-not-working-with-pdftex Removing this bug isn't trivial because of the bad concept of TeX source in \S 355 where is "goto start_cs" which returns the reading of the control sequence to the start and reads again. But the buffer includes the result of ^^ab conversion which is again transformed by encTeX. I decided to do only a simple correction which supposes that there are "normal" control sequences and two other types: with encTeX's output in their names or with ^^ab in their names. Mixing these types is still not allowed because the implementation needs new data structures and much code. IMHO: 1) probability of such mix is almost zero, 2) I don't want to add much code only because of a bad concept with "goto" in the TeX original code. The change is "robust" for the case where encTeX isn't in use, because there is the conditional "if mubyte_in>0" which is false when encTeX isn't activated. git-svn-id: svn://tug.org/texlive/trunk@35457 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/enctex.ch | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Build/source/texk/web2c/enctex.ch') diff --git a/Build/source/texk/web2c/enctex.ch b/Build/source/texk/web2c/enctex.ch index 13ff30d1faf..c0f5bfe4fa5 100644 --- a/Build/source/texk/web2c/enctex.ch +++ b/Build/source/texk/web2c/enctex.ch @@ -315,6 +315,13 @@ begin end; @z +@x [24.355] - encTeX: deactivated when reading such \^^ab control sequences + limit:=limit-d; first:=first-d; +@y + limit:=limit-d; first:=first-d; + if mubyte_in>0 then mubyte_keep := k-loc; +@z + @x [24.356] - encTeX: access the buffer via read_buffer begin repeat cur_chr:=buffer[k]; cat:=cat_code(cur_chr); incr(k); until (cat<>letter)or(k>limit); -- cgit v1.2.3