reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
185 stars 52 forks source link

\charifavailable gobbles more numbers than it should. #613

Closed Udi-Fogiel closed 6 months ago

Udi-Fogiel commented 7 months ago

I was going to reimplement \charifavailable and noticed that the following example

\documentclass{article}
\usepackage{polyglossia}
\begin{document}
        \charifavailable{41}{False Case}10000
\end{document}

results with a Bad character code (68222976) error. This is because \charifavailable{41}{False Case} expands to \char"41 and TeX's look ahead mechanism is not interrupted. It also means that \charifavailable{41}{False Case} B will produce AB, i.e. the space is gobbled.

I'm not sure if the space gobbling is intentional or not and so I don't know what is the correct fix. In either case the fix is easy.

jspitz commented 7 months ago

The gobbling is not intentional.