<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Jonathan, and others.<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 22 Feb 2021, at 10:39 am, Jonathan Kew <<a href="mailto:jfkthame@gmail.com" class="">jfkthame@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">On 21/02/2021 22:55, Ross Moore wrote:<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">The file reading has failed  before any tex accessible processing has happened (see the ebcdic example in the TeXBook)<br class="">
</blockquote>
OK.</blockquote>
</div>
</div>
</blockquote>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">
<blockquote type="cite" class="">Also pdfTeX has no trouble with an xstring example.</blockquote>
<blockquote type="cite" class="">It just seems pretty crazy that the comments need to be altered<br class="">
for that package to be used with XeTeX.<br class="">
</blockquote>
<br class="">
Well.... as long as the Latin-1 accented characters are only in comments, it arguably doesn't "really" matter; xetex logs a warning that it can't interpret them, but if you know that part of the line is going to be ignored anyway, you can ignore the warning.<br class="">
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>There’s actually a pretty easy fix, at least for XeLaTeX.</div>
<div>The package contains 2 files only:   xstring.sty  and  xstring.tex .</div>
<div>The .sty is just a 1-liner to load the .tex .</div>
<div><br class="">
</div>
<div>It could be beefed up with:</div>
<div><br class="">
</div>
<div> \RequirePackage{ifxetex}     %   is this still the best package for  \ifxetex   ?</div>
<div>\ifxetex</div>
<div>
<div class="">  \XeTeXdefaultencoding "iso-8859-1"</div>
</div>
<div>\input{xstring.tex}</div>
<div>
<div class="">  \XeTeXdefaultencoding "utf8"</div>
</div>
<div>\else</div>
<div> \input{xstring.tex}</div>
<div>\fi</div>
<div><br class="">
</div>
<div>(ignore if straight quotes have become curly ones in my email editor!)</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>Even nicer would be to beef it up further by:</div>
<div> 1. record the current default encoding – is this possible ?</div>
<div>     then restore from this.</div>
<div> 2. use a grouping while deciding what to do, </div>
<div>     expanding the required commands before ending the group.</div>
<div><br class="">
</div>
<div>\showthe\XeTeXdefaultencoding  doesn’t work, </div>
<div>so is there another container that tells what is the default encoding?</div>
<div>Or should we always assume it is UTF-8 and revert to that afterwards?</div>
<div><br class="">
</div>
<div>e.g. something like:</div>
<div><br class="">
</div>
<div>\RequirePackage{ifxetex} </div>
<div>\begingroup</div>
<div> \def\next{\endgroup \input{xstring.tex}}%</div>
<div> \ifxetex</div>
<div>  \XeTeXdefaultencoding "iso-8859-1"</div>
<div class="">
<div>  \def\next{\endgroup </div>
<div>   \input{xstring.tex}%</div>
<div>   \XeTeXdefaultencoding "utf8"}%</div>
</div>
<div> \fi</div>
<div class="">\next</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">(pdfTeX doesn't care because it simply reads the bytes from the file; any interpretation of bytes as one encoding or another is handled at the TeX macro level.)<br class="">
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Right. </div>
<div>Which is why I do my PDF development work in pdfTeX before </div>
<div>testing whether it can be adapted also to XeTeX and/or LuaTeX.</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class=""><br class="">
JK<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Cheers.</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>Ross</div>
<br class="">
<div class=""><br class="">
Dr Ross Moore<br class="">
Department of Mathematics and Statistics 
<div class="">12 Wally’s Walk, Level 7, Room 734<br class="">
Macquarie University, NSW 2109, Australia<br class="">
T: +61 2 9850 8955  |  F: +61 2 9850 8114<br class="">
M:+61 407 288 255  |  E: <a href="mailto:ross.moore@mq.edu.au" class="">ross.moore@mq.edu.au</a><br class="">
<a href="http://www.maths.mq.edu.au" class="">http://www.maths.mq.edu.au</a><span style="font-size: 12px; line-height: normal;"><a href="http://mq.edu.au/" target="_blank" style="font-size: 12px; line-height: normal;" class=""><span><br class="Apple-interchange-newline" style="caret-color: rgb(0, 105, 217); color: rgb(0, 105, 217); font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Arial, sans-serif; orphans: 2; widows: 2;">
<span style="caret-color: rgb(0, 105, 217); color: rgb(0, 105, 217); font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Arial, sans-serif; orphans: 2; widows: 2;"><span><span><span><span><img apple-inline="yes" id="C7337D15-2BE2-4B06-A928-7956066C43DC" src="cid:image001.png@01D030BE.D37A46F0" class=""></span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">CRICOS
 Provider Number 00002J. Think before you</span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class=""> </span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">print. </span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">Please
 consider the environment before printing this</span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class=""> </span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">email.</span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">This
 message is intended for the addressee named</span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class=""> </span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">and
 may </span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">contain
 confidential information. If you are not the</span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class=""> </span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">intended </span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">recipient,
 please delete it and notify the sender. Views</span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class=""> </span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">expressed </span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">in
 this message are those of the individual sender, and</span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class=""> </span><span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">are
 not </span><br style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none;" class="">
<span style="font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-decoration: none; float: none; display: inline !important;" class="">necessarily
 the views of Macquarie University.</span> </span></span></span></span></span></a></span></div>
<a href="http://mq.edu.au/" target="_blank" style="font-size: 12px; line-height: normal;" class=""></a></div>
<br class="">
</body>
</html>