Yes, but I did not try to fix that. This patch addresses only the encoding
issues, bug 1820 is a language problem. After looking at
LyXFont::latexWriteStartChanges I was not surprised that this bug exists.
It is most probably a consequence of using a "paragraph language" as
opposed to the language of the character in question.
As explained in my previous message, this is actually not the cause,
although it does add another level of complexity; in fact, I just tried
it out now, and the input in this case is wrong in another sense, too
(besides the fact that 1820 still occurs): say I have a Hebrew paragraph
as follows (caps are Hebrew):
ABC def\footnote{english} ghi JKL
the output should look like this:
LKJ def{1} ghi CBA
however, it actually looks like this:
LKJ ghi {1}def CBA
(note that the two english words in the paragraph are in the wrong
order, and the footnote appears at the "hebrew end" of the first word).
I'm not sure where the problem is coming from now, but it's a new level.
Again, keep in mind that perhaps your latest patches in this thread may
have fixed this second issue --- haven't tested it yet...
IMHO this "paragraph
language" is not useful in general, and we should rather use the languages
of the single characters we are dealing with.
I think that's correct, with one caveat: in mixed RTL/LTR documents, it
*is* important to keep the concept of a "paragraph language" in order to
determine the paragraph's alignment. Traditionally, LyX has determined
the paragraph's language based on the language of the first letter
(logically) in the paragraph, and that's okay. However, in the context
of the above situations, you're right in that what should be used to
determine the "surrounding" language is the individual letters, and not
that paragraph as a whole.
Just one more note, once this "paragraph language" issue is up: the
question arises, what happens if I want a Hebrew paragraph, but which
starts with an English word (strange as this may sound, I've actually
had this kind of thing quite often; for example, a Hebrew paragraph
defining some English term). The solution in these situations has been
to insert at the beginning of the paragraph a LyX note in the language
that we want the paragraph to be in. That way, the paragraph language is
determined by the language of the note, but the first *apparent* word in
the paragraph can still be in the other language. This solution is not
bad, but is a bit of a hack --- a user who doesn't know about it, won't
figure out on his own that this is what should be done to get the
desired result. Perhaps once we're thinking about "paragraph language"
issues, anyone has any suggestions for this?
Dov