[XeTeX] printing of characters above "FFFF with \string \meaning (and potentially \Uchar)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Apr 23 15:56:10 CEST 2015

On 23/04/2015 14:07, David Carlisle wrote:
> Last year I asked about the possibility of adding \Uchar copied from luatex.
> http://tug.org/pipermail/xetex/2014-May/025260.html
> Bruno suggested a possible implementation, and I finally got round to
> trying that
> adjusted for the sources as in the texlive 2015 pretest tree (diff attached)
> This seems to work fine for characters below "FFFF
> but fails for non BMP characters above that.
> See the attached xetexuchar.tex file and the log produced by
> luatex and (patched) xetex.
> It just uses the same print_char routine as \string so I thought I'd test
> that.
> See the file nonbmp.tex (which can be used with a non-patched xetex)
> As can be seen with the attached logs this works with luatex with
> \string on U+1D538 producing a single character, but with xetex it produces
> two (presumably the UTF-16 surrogate pair, although I didn't check that).
> Is my reading of this file correct and \string and meaning are turning
> U+1D538  into two characters, and if so does anyone have a suggestion
> of the best place this should be attacked in the source?
> David

Obviously the non-BMP issue needs to be tackled, but I wonder if \Uchar
could be added in any case. It would bring functionality in this area
closer to LuaTeX and presumably the high chars business can be viewed as
a separate issue.
Joseph Wright

More information about the XeTeX mailing list