In plain TeX,
\char<int>
produces character with decimal code <int>. Similarly,
\char'<oct>
\char"<hex>
produce character with octal code<oct>, and hexadecimal code <hex> respectively.
Is there such a way of typing Unicode symbols ?
Thank you.
In plain TeX,
\char<int>
produces character with decimal code <int>. Similarly,
\char'<oct>
\char"<hex>
produce character with octal code<oct>, and hexadecimal code <hex> respectively.
Is there such a way of typing Unicode symbols ?
Thank you.
You can somewhat emulate Unicode also with Plain TeX; say you want to input ć and get \'c out of it.
\catcode"C4=\active % 0xC4 is a two-byte prefix in UTF-8
\def^^c4#1{\csname\string^^c4#1\endcsname}
\expandafter\def\csname\string^^c4^^87\endcsname{\'c}
%%% add other UTF-8 characters having 0xC4 as prefix
%%% Repeat for all other UTF-8 prefixes you need
ć
\bye
Repeat for all prefixes.
You may want to look at http://petr.olsak.net/csplain-e.html for a different strategy and an already baked solution.
\char primitive, isn't it?
– jarnosc
Feb 01 '16 at 18:37
\char<number> with a number beyond 255, can you? You have to switch to XeTeX or LuaTeX for this, with many problems, of course.
– egreg
Feb 01 '16 at 18:54
\char"1234, but no output would result, unless you set up an OpenType/TrueType font.
– egreg
Feb 01 '16 at 19:04
\char to input unicode characters, so the answer should be: you can't do that with an 8bit font or engine, but you can with a unicode aware font and engine.
– jarnosc
Feb 01 '16 at 19:16
^^?
– Vesnog
Jul 29 '17 at 22:54
^^ see What is the role of an unescaped circumflex or hat character?. For finding the UTF-8 representation you can use http://r12a.github.io/apps/conversion/
– egreg
Jul 30 '17 at 06:28
You need an unicode aware engine to do it; macro packages like Plain cannot do it by themselves. Examples of unicode aware engines are xetex and luatex, and perhaps etex and pdftex with the enctex extension.
\char"<hex>works, or may be the expandable\Uchar"<hex>. – Manuel Jan 29 '16 at 00:15