<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><br clear="all"></div>Last year I asked about the possibility of adding \Uchar copied from luatex.<br><br><a href="http://tug.org/pipermail/xetex/2014-May/025260.html">http://tug.org/pipermail/xetex/2014-May/025260.html</a><br><br></div>Bruno suggested a possible implementation, and I finally got round to trying that <br></div>adjusted for the sources as in the texlive 2015 pretest tree (diff attached)<br><br></div>This seems to work fine for characters below "FFFF <br>but fails for non BMP characters above that. <br><br>See the attached xetexuchar.tex file and the log produced by<br>luatex and (patched) xetex.<br></div><br>It just uses the same print_char routine as \string so I thought I'd test that.<br></div>See the file nonbmp.tex (which can be used with a non-patched xetex)<br><br></div>As can be seen with the attached logs this works with luatex with<br></div>\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).<br><br></div>Is my reading of this file correct and \string and meaning are turning<br>U+1D538  into two characters, and if so does anyone have a suggestion<br></div>of the best place this should be attacked in the source?<br><br></div><div><br></div>David<br><br><br><div><div><div><div><div><br><div><div><div><br><br></div></div></div></div></div></div></div></div></div>