![](https://secure.gravatar.com/avatar/565476157eb3895a9c928ffce26d988d.jpg?s=120&d=mm&r=g)
Here you go (thanks to Nanning): \def\numbertoutf#1% {\ifnum#1<128 \rawcharacter{#1}% \else\ifnum#1<2048 \rawcharacter{\the\numexpr192+(#1-32)/64\relax}% \rawcharacter{\the\numexpr128 +(#1-((#1-32)/64)*64)\relax}% \else % 3 bytes \rawcharacter{\the\numexpr224 +(#1-2048)/4096\relax}% \rawcharacter{\the\numexpr128 +(#1-(((#1-2048)/4096)*4096)-32) /64\relax}% \rawcharacter{\the\numexpr128 +(#1-(((#1-2048)/4096)*4096) -((#1-(((#1-2048)/4096)*4096)-32) /64)*64)\relax}% \fi\fi} Hans Hagen wrote:
Taco Hoekwater wrote:
Here is the problem:
\message{\the\numexpr 15/10 } % <- it rounds instead of truncates!
your actual numbers were ok, afaik.
so do i need to fix something (subtract 1 from #1 or so?) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------