[Tex/LaTex] hyperref, lualatex and unicode bookmarks issue (garbled page numbers in AR for Linux)

hyperrefluatex

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.

Best Answer

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.

Related Question