# TeX Live 2012, XeLaTeX, moderncv, error “Failed to convert input string to UTF16”

I'm getting this error from moderncv version 1.1.1. With earlier version everything was ok and I did not make any changes to my tex document. I don't use any special font. File encoding is set to utf-8. What is the problem?

-
There are some changes which are not documented. But we need an example to see your error. At the moment we can guess. –  Marco Daniel Aug 10 '12 at 23:01
@Teddy There are some warnings that appear with TL2012 that used to be suppressed: they don't reflect a change of outcome. As Marco says, we could do to see the error to know if this is what you are seeing. –  Joseph Wright Aug 11 '12 at 7:40
This is a minimal working example: ideone.com/F8Njm The error is ** WARNING ** Failed to convert input string to UTF16... and it's printed only once when compiling a document by first time. It's being printed 11 times when document is being compiled twice or more. If I delete *.aux, *.log and *.out files and again do xelatex template.tex - it backs to previous state (prints error about UTF16 only once). –  Teddy Aug 11 '12 at 10:51

moderncv loads hyperref with the option unicode. This leads to the warning as you can try with this minimal example:

\documentclass{article}
\usepackage[unicode]{hyperref}
\hypersetup{pdfkeywords   = {test}}
\begin{document}
abx
\end{document}


The warning is described in section 6 of readme.pdf from hyperref. The best would be if moderncv would not use the option when xelatex is used.

-
I need xelatex because i use fontspec package and some packages that handle unicode. Is there any good reason to switch to pdflatex or should I stay with xelatex? –  Teddy Aug 11 '12 at 14:01
I either can't disable this by \usepackage[unicode=false]{hyperref} or \usepackage{hyperref} \hypersetup{unicode=false}. –  Teddy Aug 11 '12 at 14:14
Also with \usepackage[pdftex]{hyperref} it complains that xetex driver only supports unicode. Seven hells.. –  Teddy Aug 11 '12 at 14:20
Try \usepackage[unicode,pdfencoding=auto]{hyperref} just before \begin{document}. –  Ulrike Fischer Aug 11 '12 at 15:29
Thanks. This did the trick. –  Teddy Aug 11 '12 at 15:41

I had the same problem, when using options like pdftitle , pdfkeywords , . . . I changed to use pdfinfo and now everything is workng fine. the syntax is like this:

\hypersetup{
pdfinfo={
Title={My Title},
Subject={My Subject},
NewKey={Foobar},
% ...
}
}


for more info you can refer to hyperrefdocumentation page 11.

-