[Tex/LaTex] Do XeTeX and LuaTeX always use Unicode

luatexpdftextex-coreunicodexetex

I am writing some functions to manipulate strings. A typical way to produce a character with a given character code is the \lowercase primitive. The following code produces a character with code 234, and displays it to the terminal.

\lccode`*=234
\lowercase{\message{*}}

If I replace 234 by 345 above, then pdfTeX raises an error: Invalid code (345), should be in the range 0..255. On the other hand, LuaTeX and XeTeX are happy up to 1114111, as expected from a Unicode-compliant engine.

Now, I want my macros to be as robust as possible. Is it always true that the maximum lccode is 255 in pdfTeX and 1114111 in LuaTeX and XeTeX? Or can a user prevent in any way the engine from using the full range, hence confusing my macros?

Best Answer

The LuaTeX manual says quite clearly that \char now accepts values between 0 and 1114111 and extends this statement to the other similar commands like \lccode. As far as I know this is true in XeTeX too. And IMHO a command line to change this seems rather senseless.

But the eTeX extension can be disabled in both engines. Or more precisely: XeTeX has a command line option to enable the eTeX extension (which is used by default by all TeX Systems) and LuaTeX has a similar feature. So it is possible to build a format manually which doesn't use them. But this affects only the eTeX relevant commands.