bug-texinfo
[Top][All Lists]

## Re: Index wrongly encoded with UTF-8

 From: Gavin Smith Subject: Re: Index wrongly encoded with UTF-8 Date: Mon, 31 Jul 2017 19:57:26 +0100 User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jul 31, 2017 at 08:39:13AM +0200, Vincent Belaïche wrote:
> You mean that with TeXLive the bug does not exist.
>
> What is supposed to do tex when \write-ing and there are active-chars ? I
> presume that the active-chars are developped like any command would be. I am
> surprised that MikTeX (MT) and TeXLive (TL) do not do the same output.

If it is defined as a macro with \def or similar, it is expanded (but
not executed).

Index: texinfo.tex
===================================================================
--- texinfo.tex (revision 7905)
+++ texinfo.tex (working copy)
@@ -4870,6 +4870,10 @@
%
% Do the redefinitions.
\definedummies
+  %
+   \ifx\declaredencoding\utfeight
+           \setnonasciicharscatcodenonglobal\active
+     \fi
}

% Used for the aux and toc files, where @ is the escape character.

But the output was as expected.

The only idea I have of where a space could have been inserted is if
there is an extra space in a macro that is being used, for example if
a line didn't end in a %.

Due to the definition of the high-value bytes, which use the
\ifpassthroughchars conditional, the bytes should be output properly
even if they are active. The definitions are around line 10276 in
texinfo.tex, following the comment

% Give non-ASCII bytes the active definitions for processing UTF-8 sequences

Maybe you could experiment with changing these definitions to see if it
makes any difference, for example if I make the following change:

@@ -10295,7 +10297,7 @@
\countUTFy = "C2
\def\UTFviiiTmp{%
\gdef~{%
-        \ifpassthroughchars $\fi}}% + \ifpassthroughchars X$\fi}}%
\UTFviiiLoop

\countUTFx = "C2

Then I get an extra X inserted between some of the bytes of the UTF-8
sequences in the index files.

> So my 1st naive question = are you sure that you used the latest texinfo.tex
> (that on the texinfo repo, not that which TL has) ? Please check your
> compile log file.

Yes, the version I used is 2017-07-04.16 which is the latest version.