[XeTeX] \meaning on an outside BMP character

Qing Lee sobenlee at gmail.com
Sun Jun 30 08:20:13 CEST 2013


It is relevant to the subject below.


I want to catch the character code of an implicit token by using
the \meaning trick. But it seems that \meaning of XeTeX does not
return the expected result on an outside BMP character (>= 0x10000).

My XeTeX version is

XeTeX 3.1415926-2.5-0.9999.3-2013060713 (TeX Live 2013/W32TeX)

Here is a MWE.

\let\testchar=^^^^^1d6fc %% \mitalpha
\def\GetCharcodeAux#1 #2 #3{\cnta=`#3 }
\showthe\cnta %% -> 120572 0x1D6FC
\def\GetCharcodeAux#1 #2 #3#4{\cntb=`#3 \cntc`#4 }
\showthe\cntb %% -> 55349  0xD835
\showthe\cntc %% -> 57084  0xDEFC
%% convert UTF-16 to unicode
\cnta=\numexpr ( \cntb - "D800 ) * "400 + ( \cntc - "DC00 ) + "10000 \relax
\showthe\cnta %% -> 120572 0x1D6FC

LuaTeX works fine with characters outside BMP. It seems that XeTeX
return the UTF-16 code units instead of the real character outside BMP.

This is intentional or an oversight?

Qing Lee

More information about the XeTeX mailing list