# hyperref: pdftitle and wrong character encoding [duplicate]

\documentclass[12pt,a4paper]{mwrep}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\begin{document}
Text
\end{document}


How can I make pdftitle correctly generated? I'm getting (checked with Adobe Reader X):
Sometitle»¹¢¡¦±¢ó
There are no spaces and there are fizzled Polish diacritics. How can this be fixed?

-

## marked as duplicate by diabonas, doncherry, egreg, Seamus, lockstepNov 24 '11 at 18:18

The spaces are kept if you put the title in braces. If you compile with lualatex or xelatex the Polish diacritics work. I don't how to make it work with pdflatex. –  Torbjørn T. Nov 21 '11 at 18:09

Use \hypersetup to set up strings:

\documentclass[12pt,a4paper]{mwrep}
\usepackage{polski}
\usepackage[utf8]{inputenc}

It seems that the option unicode works for the strings set up in \hypersetup, but not for the strings set up in options. This is probably the reason why the method you recommend works. –  Boris Nov 21 '11 at 18:24
@Boris: The optional argument of \usepackage is ready by the LaTeX kernel, so hyperref cannot change scanning of the argument. The argument of \hypersetup will be read under control of hyperref. hyperref may e.g. change encoding before reading the argument. –  Schweinebacke Nov 22 '11 at 1:00