[XeTeX] Making a .fmt file using XeTeX

Jonathan Kew jonathan_kew at sil.org
Mon Feb 21 20:54:21 CET 2005

On 21 Feb 2005, at 6:58 pm, Stephen Moye wrote:

> Now for something very strange.
> I'm having my perl script insert the '%&encoding=UTF-8 Unicode' line 
> at the top of the file. When I run an old TeX file through the script, 
> the resulting new TeX file does not TeX correctly -- the accents are 
> missing or wrong.

In that case, I believe the file is not being generated with the 
correct Unicode characters/encoding....

> After a good deal of fevered (literally, I came down with the flu 
> yesterday) experimentation, I discovered that if, in the 
> perl-generated file, I delete the space between '8' and 'Unicode' and 
> type in a new space from the keyboard thus replacing the old space, 
> the resulting file TeXs correctly.

....but when you make a change (*any* change, there's nothing magic 
about that particular space) in TeXShop, it gets re-written with the 
proper characters.

Given what you said earlier about a warning from TeXShop when you first 
open the file, I'm guessing it's actually MacRoman at that point; 
TeXShop sees the %&encoding line but finds that it isn't valid UTF-8, 
so it falls back to MacRoman and converts as it reads. Then, because of 
the %&encoding line, it writes the file as Unicode, and after that 
it'll typeset correctly.

> I don't know what else to try changing in the script.

Let's see how you're creating the output file in the script, and 
writing to it. That's what I think isn't working.


More information about the XeTeX mailing list