\char<number>
is a TeX primitive that results in the character of ASCII code <number>
with category code 12. However, it isn't expandable, unlike it's many cousins \romannumeral
, \number
, etc.
From my understanding, \char
does not look up upper/lowercase/catcode tables, like \uppercase
and \lowercase
, so I'm confused as to why it unexpandable. (I'm not really sure if this is related at all, but I remember from the top of my head that it's the case for \upper/lowercase
)
\expandafter
. See also tex.stackexchange.com/questions/467360/…\char
accesses a slot in a font and the glyphs at these slots are not necessarily representable in 8-bit encoding in a meaningful way. It's different for Unicode, where all characters are representable in UTF-8 encoding which is why\Uchar
in LuaTeX is expandable.