> Date: Tue, 19 Feb 2019 10:06:15 +0100 > From: Patrice Dumas <[email protected]> > > > I can't remember what I was thinking when I wrote this code, but I may > > have been thinking about the case of different encodings in different > > input files. I don't think that use case is worth supporting, though. > > I disagree, I think that it is worth supporting that case, as the file > is the natural scope for encoding. That being said, the first > documentencoding could set the default even if it is in an include file. > > Looking at the perl parser, it seems that the encoding is reset for all > the input files upon reading @documentencoding, so a @documentencoding > in an include file resets the main file documentencoding. I would say > that this is incorrect.
Whether a mistake or not, this command exists in Texinfo for too long to change it now in backward-incompatible ways. It always produced a global setting which was in effect for the whole document. The main use case of @documentencoding is exactly to specify a single encoding for the entire document. The use case you propose sounds like a much more marginal one. In fact, I cannot even envision when would that be useful -- to produce an HTML document where each section is in a different language, perhaps? So I think if we want such a file-local encoding, we should introduce a new command, @fileencoding, say. That would be backward-compatible.
