[Tex/LaTex] Problem copying text from latex PDF – special characters

characterspdf

I am using LaTeX in a portuguese document, with special characters such as tilde or cedilla. I have a sample document with the following content:

\documentclass{book}

\usepackage[utf8]{inputenc}

\begin{document}

é canção

\end{document}

My editor (TeXworks) is configured to use UTF8, and the resultant PDF shows the right result, as seen on the following image:

Generated PDF

My problem is: when I copy the text from the PDF I get weird characters, and not the text that is exhibited. How to overcome this?

Thanks.

Best Answer

You could use T1 font encoding with support for special characters:

\usepackage[T1]{fontenc}