[Dev-luatex] Unicode in \pdfinfo

Hans Hagen pragma at wxs.nl
Sat Jun 28 13:36:01 CEST 2008

Taco Hoekwater wrote:
> Khaled Hosny wrote:
>> On Fri, Jun 27, 2008 at 11:49:07PM +0200, Hans Hagen wrote:
>>> Khaled Hosny wrote:
>>>> \pdfinfo doesn't seem to support Unicode, when I compile the attached
>>>> example with luatex I get symbols like هصة instead of the proper
>>>> (Arabic) Unicode strings.
>>>> Shouldn't luatex default to Unicode here too?
>>> this is a backend c.q macro package issue ... (btw this can also be 
>>> done   in pdftex, but i never came to enabling the code in context 
>>> because  there was nothign to test)
>> I suspected that, since hyperrref with latex does this, but I found that
>> xetex supports Unicode pdfinfo directly and thought luatex should do
>> this too. 
> I could intercept \pdfinfo, but I suspect there are many more locations
> (like bookmarks). Hans, would automatic conversion to utf16 be doable?

i'd rather wait with such things till the backend is redesigned; in 
principle one can have pdfdoc encoding or unicode in (strings) but also 
use <hex numbered strings>; it may help at some point to have a 
string.utf8to16 function which can be used in drivers (going from utf8 
to utf16 is somewhat cumbersome in lua), so that backend code could do

\pdfinfo{ ... /someentry
     {tex.write(utf16bom..string.utf8toutf16{...}} ... }

so, no intercept (after all, that would involve parsing and always be 
moving target) but just a helper

(it's already doable but mostly a matter if supporting it -)


                                           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

More information about the dev-luatex mailing list