<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Many Thanks!<BR>
<BR>
Wenchang<BR><BR>> From: jonathan@jfkew.plus.com<BR>> To: xetex@tug.org<BR>> Date: Mon, 4 Aug 2008 14:34:54 +0100<BR>> Subject: Re: [XeTeX] Problem with XeTeXdefaultencoding<BR>> <BR>> On 4 Aug 2008, at 1:39 PM, SUN Wenchang wrote:<BR>> <BR>> ><BR>> ><BR>> > Dear All,<BR>> ><BR>> > For some reasons, I need to change the default inputencoding. After <BR>> > the default encoding is changed back to utf-8,<BR>> > it can not ignore the UTF-8 leading bytes BOM in a subsequent call <BR>> > to \input{file}.<BR>> ><BR>> > Attached is an example.<BR>> > Note that main-a.tex is a copy of main.tex except removing the line<BR>> > \XeTeXdefaultencoding 'UTF-8'<BR>> ><BR>> <BR>> Use \XeTeXdefaultencoding "auto" to restore the default behavior.<BR>> <BR>> XeTeX only "sniffs" the first bytes of the file to determine the <BR>> encoding (and skips an initial BOM, if found) when it i!
s using the <BR>> default "auto" encoding mode. If you explicitly set an encoding -- <BR>> including UTF-8 or a UTF-16 form -- it will simply read the entire <BR>> file using that encoding.<BR>> <BR>> If you want to explicitly set the encoding to UTF-8, yet still ignore <BR>> the BOM, you could do this with \catcode"FEFF=9. Or if you think it <BR>> might occur (functioning as ZWNBSP) elsewhere in the text, something <BR>> like<BR>> <BR>> \catcode"FEFF=\active \def^^^^feff{\ifhmode\kern0pt\fi}<BR>> <BR>> might be useful.<BR>> <BR>> JK<BR>> <BR>> <BR>> _______________________________________________<BR>> XeTeX mailing list<BR>> postmaster@tug.org<BR>> http://tug.org/mailman/listinfo/xetex<BR><BR><br /><hr />聰明搜尋和瀏覽網路的免費工具列 — <a href='http://toolbar.live.com/' target='_new'>Windows Live 搜尋工具列</a></body>
</html>