<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 14 Mar 2008, at 7:02 am, SUN Wenchang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> Hi,<br>  <br> I had trouble with \XeTeXdaultencoding. The following tex file can not be compiled correctly:<br>  <br> \XeTeXdefaultencoding "GBK"<br>\documentclass{article}<br>\usepackage{fontspec}<br>\setmainfont{SimSun}<br>\begin{document}<br> \tableofcontents<br>\section{中文}<br>中文<br>\end{document}<br><br> I find that the "output encoding" used in aux, toc, ... is always UTF8, no mater which input encoding is used. </blockquote><div><br class="webkit-block-placeholder"></div><div>Yes, that's correct.</div><br><blockquote type="cite"><br> As a result, to change the default encoding may get into troubles.</blockquote><div><br class="webkit-block-placeholder"></div><div>True. Changing the default encoding may be useful before loading a non-Unicode file, but you'll need to change it back before reading any file that xetex itself has generated, such as the .toc or .aux file.</div><div><br class="webkit-block-placeholder"></div><div>In general, I would strongly recommend using Unicode (UTF-8) for your input text, if at all possible.</div><div><br class="webkit-block-placeholder"></div><div>JK</div><div><br class="webkit-block-placeholder"></div><blockquote type="cite"><br>  <br> PS: Changing the default encoding is useful with Windows + WinEdt. <br>  <br> Wenchang<br><br><hr>用部落格分享照片、影音、趣味小工具和最愛清單,盡情秀出你自己 — <a href="http://spaces.live.com/" target="_new">Windows Live Spaces</a><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">XeTeX mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:postmaster@tug.org">postmaster@tug.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</a></div> </blockquote></div><br></body></html>