RE2: Babel invoke inputenc where inputenc is not designed for xetex or luatex

outlook user RACP at outlook.fr
Sun May 12 16:32:40 CEST 2024


Thanks for your reply!

You've replied about invalid UTF-8 sequences on the issue about InputEnc (if I get it right)

So Babel treats differently `\usepackage[arabic]{babel}` and `\babelprovide{arabic}`? It's curious. It's inherited/legacy syntax or both are meant for different cases? If it's inherited then Babel should raise a warning when using a deprecated syntax because it'll cause what happens to me for the time. Or maybe that syntax is to re-order after engine setup, hence two different lines, idk

If maybe you know Arabi maintainer mail we can hook him to that exchange

________________________________________
De : David Carlisle <d.p.carlisle at gmail.com>
Envoyé : dimanche 12 mai 2024 15:51
À : outlook user <RACP at outlook.fr>
Cc : texhax at tug.org <texhax at tug.org>
Objet : Re: Babel invoke inputenc where inputenc is not designed for xetex or luatex
 
in texlive 20204 (and probably all earlier versions)
any use of \usepackage[arabic]{babel}  will raise errors with
lualatex or xelatex as the arabi package files are not in UTF-8
You should raise this with the arabi package maintainer.

with lualatex:

(/usr/local/texlive/2024/texmf-dist/tex/latex/arabi/arabicore.sty
  Arabi Core switching commands v1.0  2006/01/01   (may still change)  
! String contains an invalid utf-8 sequence.
l.137 \ifcase#1\or
                 ��������� � \ \or �����������^^@�^^@^^@

xelatex recovers from that but then errors on

! Package inputenc Error: inputenc is not designed for xetex or luatex.
(inputenc)                only UTF-8 supported.




I _think_ the recommended way to specify the language these days is

\documentclass{article}

\usepackage{babel}
\babelprovide{arabic}

\begin{document}

x
\end{document}

which allows babel to keep control.


On Sun, 12 May 2024 at 14:31, outlook user <RACP at outlook.fr> wrote:
> (inputenc)                only UTF-8 supported.
>
> See the inputenc package documentation for explanation.
> Type  H <return>  for immediate help.
>  ...                                              
>                                                   
> l.164 \endinput
             
> For xelatex or lualatex save the document in UTF-8 encoding
> and do not use inputenc, or use the [utf8] option.

On version 1.16.0 from TeX Live distribution version 2023 using LUALaTeX 2023.8.28. It appears when `\usepackage{babel}` is modified to `\usepackage[arabic]{babel}`

>From what I understand LUATeX use by default UTF-8 and using inputenc will conflict with it because it tries to re-define the encoding which is locked in LUA/Xe, so will end up in a "crash". So Babel (or whatever invoke it) shouldn't do it (I think it tries to use cp1256 here, despite not asking for it) when not using PDFTeX (or whatever needs it), like on that case. And worse, some calls takes priority so re-using inputenc to ask for UTF-8 won't correct the problem because it takes the first call only



More information about the texhax mailing list.