luatex add tag
Caleb (imported from SE)
I use `hyperref` for a number of reasons, but among other things it sets up the document properties up well. As long as I compile with XeLaTeX that is. As soon as I compile with LuaLaTeX, everything is a jumble. There are many more fields with issues in my real project, but here is an MWE using just the title field:

    \documentclass{scrartcl}
    \usepackage{polyglossia}
    \setmainlanguage{turkish}
    \makeatletter
    \usepackage[hidelinks]{hyperref}
    \AtBeginDocument{%
    	\hypersetup{%
    		pdftitle = {\@title}
    	}
    }{}
    \makeatother
    \title{RAB'BİN GÜNÜ}
    \begin{document}
    Title in document properties should match: RAB'BİN GÜNÜ 
    \end{document}

Compile with `xelatex` gives me:
 
> **Title:** RAB’BİN GÜNÜ

But `lualatex` eats Unicode for lunch and has indigestion:

> **Title:** RAB'BİN GÜNÜ

How do I get proper Unicode characters into the document property fields when compiling with LuaLaTeX?
Top Answer
egreg (imported from SE)
The indigestion is avoided by passing the `unicode` option to `hyperref`:

    \documentclass{scrartcl}
    \usepackage{polyglossia}
    \setmainlanguage{turkish}
    \makeatletter
    \usepackage[hidelinks,unicode]{hyperref}
    \AtBeginDocument{%
        \hypersetup{%
            pdftitle = {\@title}
        }
    }{}
    \makeatother
    \title{RAB'BİN GÜNÜ}
    \begin{document}
    Title in document properties should match: RAB'BİN GÜNÜ
    \end{document}

![enter image description here][1]

Here's the output of `pdfinfo -enc UTF-8 test.pdf` (only the relevant parts)

### LuaLaTeX

    Title:          RAB'BİN GÜNÜ
    Subject:        
    Keywords:       
    Author:         
    Creator:        LaTeX with hyperref package
    Producer:       LuaTeX-0.79.1
    CreationDate:   Tue Mar 24 12:01:09 2015
    ModDate:        Tue Mar 24 12:01:09 2015

### XeLaTeX

    Title:          RAB'BİN GÜNÜ
    Creator:        LaTeX with hyperref package
    Producer:       xdvipdfmx (20140317)
    CreationDate:   Tue Mar 24 11:58:05 2015

  [1]: https://i.stack.imgur.com/swT87.png

Answer #2
wipet (imported from SE)
The reason why the behavior differs when LuaTeX or XeTeX is used, is explained [here][1]. The XeTeX uses `xdvipdfmx` and this converter sets the UTF8 to UCS2 conversion automatically. On the other hand, when we are using direct pdfTeX primitives (like in LuaTeX) then the UTF8 to UCS2 conversion must be done at macro level. And the `hyperref` package does this when the mentioned `unicode` option is set.


  [1]: https://tex.stackexchange.com/questions/236863/incorrect-encoding-in-pdf-outlines/237277#237277

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.