Georg Baum wrote:
Am Freitag, 29. Juni 2007 15:11 schrieb Dov Feldstern:
Just a reminder: "default" is supposed to be exactly like "auto" (i.e.,
the encoding is determined based on the language), except that it
shouldn't output any "inputencoding" commands, because LaTeX will
determine the encoding on it's own. This patch achieves that, by fixing
a few places where differences between "auto" and "default" have crept
in.
They are there on purpose. The lookahead is not done for "default", because
it does not make any difference whether we do it or not: The lookahead
does only change the encoding earlier if the stuff until the real change
does work with the new encoding. If that is the case, then the output in
the case of "default" will be identical with and without lookahead.
Therefore this part of the patch does not harm, but it does not fix
anything either.
Okay, thanks for the explanation. That part is really the only part that
I changed only because it didn't look right, and not because I saw an
actual bug that it fixes. It may still be a good idea to leave it in, so
that there really is as little difference as possible between "default"
and "auto", which makes it easier to debug. Does that sound reasonable?
The other fix, though, you agree is necessary?
This should be considered a regression, because in earlier versions
Hebrew worked only with the "default" encoding.
Indeed, but I don't understand the change in Paragraph.cpp. Maybe the patch
does hide a bug elsewehere?
It's possible, I don't know. But I *can* explain why the patch works:
the 'count' is returned from switchEncoding, and is a count of how many
additional characters have been added to the latex file. In
switchEncoding, these added characters are exactly those of the
\inputencoding command. If there was no encoding switch, the count is 0;
the reverse, however, is *not* correct: there may have been an encoding
switch, and the count is still 0: if we're not outputting the encoding
switch commands, as is the case with "default". However, Paragraph.cpp
is currently assuming that if count is 0, then the encoding was not
switched, and therefore is not resetting the runparams.encoding; but as
I have shown, with "default" encoding, there are situations when
runparams.encoding should be updated, even though the count is 0, and
that's what this patch does. Maybe I should add a comment explaining this?
To be sure, I am now updating the runparams.encoding even when the
encoding has not switched, but I don't think that that really matters...
Also, just a thought: something similar to the change in Paragraph.cpp
may also be relevant to bug 3561 (which I don't understand exactly, but
may be somehow related...)?
I don't think so.
it was just a thought ... ;)
Georg
Thanks, Georg!
Dov