G. Milde wrote:
On 20.07.08, Paul A. Rubin wrote:
Jürgen Spitzmüller wrote:
Anyway, I don't think you'll find a working example. As listings fails
with multibyte glyphs, it will also fail when multibyte glyphs are used
in ERT, no?
Not according to the documentation. You can define an "escape to LaTeX"
character, and anything bracketed by that character is handed off to
LaTeX verbatim. According to the docs, that allows you to put multibyte
characters in a comment (though apparently _only_ in a comment).
Anyway, I can't find a way to test this here, since I don't have any CJK
fonts installed and wouldn't know how to use them if I did.
You can insert a comment with some accented latin characters (like ä or
é) and set the encoding to utf8.
If this is an issue, we'll find out when someone barks about it. Until
then, I'm not sure it's worth worrying about.
True again.
BTW: While German does not depend on a multibyte encoding, the German
umlauts are multibyte characters in UTF-8.
Günter
Thanks for the tip, Günter. I'm attaching a small proof-of-concept
example that shows three things:
1. The version of the listing done in ERT comes out correctly,
including Günter's two example multibyte characters.
2. The version done with a listing inset (which has the ä removed for
reasons I'll mention in a minute) comes out but with the second comment
garbled. I assume this is because forcing latin1 encoding results in
the two bytes of é being interpreted as separate characters.
3. If you put the ä back in the document and try to compile it, not
only are the two bytes interpreted as separate characters, but one of
them apparently is not available in T1, so LaTeX throws an error message.
That last part means that we may not be entirely successful in
protecting the user from himself (unless Jürgen's patch fixes that).
All that said, it's not an issue for me, and I don't recall any users
complaining that their comments turned into Klingon, so it's not a
priority issue.
Cheers,
Paul