# hyperref, lualatex and unicode bookmarks issue (garbled page numbers in AR for Linux)

I have text with some non-ascii characters in chapters, sections... which I'd like to see in bookmarks displayed correctly. I noticed that,

• If I run xelatex, everything is fine, no need to set \hypersetup{unicode=true} to get this working
• If I run lualatex, I have these issues:

1. If unicode=false, then bookmarks containing non-ascii characters have strange unreadable symbols instead of those chars, but everything else is fine

2. If unicode=true, then bookmarks are just fine, but page numbers in resulting PDF file are garbled in Adobe Reader 9 on Linux (and Okular shows some strange symbols in bookmark pane too)

Is it a driver issue? Any suggestion how to overcome this problem?

Here's a MWE:

\documentclass{article}
\usepackage{hyperref}
%\hypersetup{unicode=true}

\begin{document}

\section{Test 1 čćžđš}
Some text.\clearpage

\section{Test 2 šđžćč}
Some text.

\end{document}


A notice: I tried to post this question on comp.text.tex earlier, but something went wrong and it didn't show up. Anyway, if the post shows up later, I'll post the link here.

-
it is on c.t.t. – Herbert Jul 29 '11 at 19:42
I can't find it :( – Meho R. Jul 29 '11 at 21:35
the answer from Heiko is also there – Herbert Jul 29 '11 at 21:36
Is there a link? And if you're referring to this post (groups.google.com/group/comp.text.tex/browse_thread/thread/…), no, there is no answer which solves this issue. – Meho R. Jul 29 '11 at 22:55
@Meho: yes, it would be great if you would post that as answer and accept it. – Stefan Kottwitz Aug 20 '11 at 14:28
show 1 more comment

I received an email from Heiko suggesting that I try auto pdfencoding which worked indeed. So, the solution is:

\hypersetup{pdfencoding=auto}


And corrected MWE from above:

\documentclass{article}
\usepackage{hyperref}
\hypersetup{%
pdfencoding=auto,
pdfauthor={Author Test ČĆŽĐŠ},
pdftitle={Title test, čćžđš}
}

\begin{document}

\section{Test 1 čćžđš}
Some text.\clearpage

\section{Test 2 šđžćč}
Some text.

\end{document}


Complete Heiko's answer can be found on comp.text.tex.

-

Even with pdfencoding=auto, I had trouble with either the bookmarks or the metadata or the page numbers. But all three come out perfectly if I use the navigator package rather than hyperref.

-
Yes, I noticed that metadata gets messed up sometimes. The solution might be to use \hypersetup locally, that is, e.g., \hypersetup{pdfencoding=utf8} before specifying author name, title and other metadata stuff, then \hypersetup{pdfencoding=auto} after that, to get bookmarks and numbers displayed correctly. – Meho R. Oct 28 '11 at 0:46