<div dir="ltr"><div><div><div><span class="">In experiments with using the inputencoding for latex <br><br><a href="https://github.com/wspr/xetex-inputenc/blob/master/xetex-inputenc.dtx">https://github.com/wspr/xetex-inputenc/blob/master/xetex-inputenc.dtx</a><br><br>deal with that problem by writing<br><br>\XeTeXinputencoding</span> "utf8"<br><br></div>at the top of the auxiliary file so that it is read back in utf8 even if the main document is<br></div>using a legacy encoding.<br><br></div>David<br><br><div class="gmail_extra"><br><div class="gmail_quote">On 12 January 2016 at 19:31, Gavin Smith <span dir="ltr"><<a href="mailto:gavinsmith0123@gmail.com" target="_blank">gavinsmith0123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It has been suggested to me to let you know about a problem we had<br>
with Texinfo with XeTeX about character encoding. XeTeX reads and<br>
writes to files by default using a UTF-8 encoding. It's possible to<br>
override the input encoding with \XeTeXdefaultencoding and<br>
\XeTeXinputencoding, but as far as we can tell there's no<br>
corresponding command for the output encoding. We managed to fix this<br>
problem for LuaTeX for both input and output, but XeTeX appears to<br>
have a setting for input only.<br>
<br>
This is a much smaller problem than it would be it would be if the<br>
input encoding couldn't be set, but it is a problem when reading and<br>
writing to auxiliary files to handle indices, cross-references and<br>
tables of contents. For example, a chapter title may have a non-ASCII<br>
character in it, e.g. "ü". When we set \XeTeXinputencoding "bytes",<br>
this is read in as two tokens with hex values c3 bc. That's intended:<br>
texinfo.tex needs the individual byte values. But then when it's<br>
written out to build up the table of contents, this gets written out<br>
as two UTF-8 characters (ü, bytes c3 83 c2 bc) which isn't what is<br>
needed: we want to write out the two bytes, that is a single UTF-8<br>
character. As it is, this means when the table of contents is typeset,<br>
the character "ü" comes out as "ü".<br>
<br>
If we're right in thinking there's no way to set the output encoding<br>
(for \write), it might be a good idea to add one.<br>
<br>
Best wishes,<br>
Gavin<br>
<br>
<br>
<br>
--------------------------------------------------<br>
Subscriptions, Archive, and List information, etc.:<br>
<a href="http://tug.org/mailman/listinfo/xetex" rel="noreferrer" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><a href="http://dpcarlisle.blogspot.com/" target="_blank">http://dpcarlisle.blogspot.com/</a></div>
</div></div>