Hi Heiko,

On 22/06/2010, at 9:26 AM, Heiko Oberdiek wrote:

>> When reading the input stream, a single line-end character might 
>> be generated at the start ?
>> But that still leaves open the question of how it picks up
>> the character string '@s...@act' .
>> Maybe it all happens internally and there is a buffer overrun?
> 
> I came to the same conclusion, see my answer to Josephs mail.


> The problem is not related to hyperref:
> 
> \documentclass{article}
> \XeTeXdefaultencoding "UTF-8"
> \AtBeginDocument{%
>  \InputIfFileExists{t003.out}{}{}
> }
> \begin{document}
> \end{document}
> 
> It shows the string "OT1/cm".

OK.

The problem is perhaps really within LaTeX's  
 \IfFileExists  command.

It doesn't use TeX's  \immediate  qualifier
when calling  \openin  and  \closein for the preliminary
check to see whether the file exists or not.
The need for this primitive is discussed in the TeXbook ,
and surely the preliminary check is precisely a place
where it should be used.

Fixing it in the preamble makes the problem go away.
viz.

>>> \makeatletter
>>> \def\IfFileExists#1#2#3{%
>>>  \immediate\open...@inputcheck #1%
>>>  \ife...@inputcheck 
>>>   \ifx\in...@path\@undefined
>>>    \def\reser...@a{#3}%
>>>   \else 
>>>    \def\reser...@a{\@iffileonpath{#1}{#2}{#3}}%
>>>   \fi 
>>>  \else
>>>   \immediate\close...@inputcheck 
>>>   \ed...@filef@und{#1 }%
>>>   \def\reser...@a{#2}%
>>>  \fi 
>>>  \reser...@a
>>> }
>>> \makeatother



Of course there may still be a need for XeTeX to
be cleaned up a bit, as it is rather weird that it 
only happens when  \XeTeXdefaultencoding  is used.

> 
> Yours sincerely
>  Heiko Oberdiek



Cheers,

        Ross

------------------------------------------------------------------------
Ross Moore                                       [email protected] 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to