I'm using XeLaTeX with Polyglossia.
I have a string like this
Three \emph{blind} Mice, Émile.
saved in a macro, thus:
\gdef\foobar{Three \emph{blind} Mice, Émile.}
and I want to send the text in \foobar into the metadata of a PDF using \pdfinfo{}, thus:
\pdfinfo{/Title (\foobar)}
It doesn't work, because the text in \foobar is sent into the PDF with messy expansion. And the Unicode chars are also messed up.
I've tried some ideas using \noexpand, \expandafter, \toks, but without any success.
Any ideas?
PS don't tell me to use \hyperref's "pdfauthor={}"mechanism, because that clashes with the pdfx package and I can't use it. And I don't want to use pdfx's xmpdata method either. I'm after a solution to the specific issue mentioned, how to change "Three \emph{blind} Mice, Émile."into "Three blind Mice, Emile." Even "Three blind Mice, Émile." would be an improvement.

\pdfinfoof pdfTeX supported in XeTeX? – Heiko Oberdiek May 22 '18 at 19:30\begingroup \renewcommand{\emph}[1]{#1}% \pdfinfo{/Title (\foobar)} \endgroupshould do the trick. If there other formatting commands, they will need to be redefined within the group. – Peter Grill Oct 16 '20 at 16:58