<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 David.<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 21 Feb 2021, at 10:12 pm, David Carlisle <<a href="mailto:d.p.carlisle@gmail.com" class="">d.p.carlisle@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">I think that should be taken up with the xstring maintainers.</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Is  xstring  intended for use with XeTeX ?</div>
<div>I suspect not. </div>
<div>But anyway, there are still issues with this.</div>
<div><br class="">
</div>
<div>(BTW, I wrote this before Jonathan Kew’s response.)</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class=""><br class="">
</div>
<div class="">I don't think there is any reasonable way to say you can comment out parts of a file in a different encoding.</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>I’m not convinced that this ought to be correct for TeX-based software.</div>
<div><br class="">
</div>
<div>TeX (not necessarily XeTeX) has always operated as a finite-state machine.</div>
<div>It *should* be possible to say that this part is encoded as such-and-such,</div>
<div>and a later part encoded differently.</div>
<div><br class="">
</div>
<div>I fully understand that editor software external to TeX might well have difficulties </div>
<div>with files that mix encodings this way, but TeX itself has always been byte-based </div>
<div>and should remain that way.</div>
<div><br class="">
</div>
<div>A comment character is meant to be viewed as saying that:</div>
<div> *everything else on this line is to be ignored*</div>
<div>– that’s the impression given by TeX documentation.</div>
<div><br class="">
</div>
<div>If it is the documentation that is incorrect, then it should certainly be clarified.</div>
<div><br class="">
</div>
<div>For XeTeX and this particular example, it’s probably just a matter of checking </div>
<div>that the non-UTF8 characters occur *after* a UTF-8  ‘%' , and not issuing </div>
<div>an error message under these conditions. </div>
<div>A warning, maybe, but not an error.</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class=""><br class="">
</div>
<div class="">The file encoding specifies the byte stream interpretation before any tex tokenization</div>
<div class="">If the file can not be interpreted as utf-8 then it can't be interpreted at all.
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Why not?</div>
<div>Why can you not have a macro — presumably best on a single line by itself –</div>
<div>that says what follows next is to be interpreted in a different way to what came previously?</div>
<div>Until the next switch that returns to UTF-8 or whatever?</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>If XeTeX is based on eTeX, then this should be possible in that setting.</div>
<div><br class="">
</div>
<div><br class="">
</div>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Even replacing by U+FFFD <br class="">
</div>
<div class="">is being lenient.</div>
<div class=""><br class="">
</div>
<div class="">David</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, 21 Feb 2021 at 11:04, jfbu <<a href="mailto:jfbu@free.fr" class="">jfbu@free.fr</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi,<br class="">
<br class="">
consider this<br class="">
<br class="">
\documentclass{article}<br class="">
\usepackage{xstring}<br class="">
\begin{document}<br class="">
\end{document}<br class="">
<br class="">
and call it xexstring.tex<br class="">
<br class="">
Then xelatex xexstring triggers 136 warnings of the type<br class="">
<br class="">
Invalid UTF-8 byte or sequence at line 35 replaced by U+FFFD.<br class="">
<br class="">
Looking at file<br class="">
<br class="">
/usr/local/texlive/2020/texmf-dist/tex/generic/xstring/xstring.tex<br class="">
<br class="">
I see that this matches with use of latin-1 encoded characters in comments.<br class="">
<br class="">
Notice that it is a not a user decision here to use a latin-1<br class="">
encoded file.<br class="">
<br class="">
In fact I encountered this in a file I was given where<br class="">
xstring package was loaded by another package.<br class="">
<br class="">
Regards,<br class="">
<br class="">
Jean-François<br class="">
</blockquote>
</div>
</div>
</blockquote>
<br class="">
</div>
<div><br class="">
</div>
<div>Cheers.</div>
<div><br class="">
</div>
<div><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="C0FD618D-9F58-4849-A6D4-E87ABC33A342" 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>