[Tex/LaTex] How to write properly an accent in a web address

accentshyperrefunicodeurls

I'm trying to write a hyperlink for a DjVu document that includes Latin accent, but for some reason, it only displays properly for the PDF one. Specifically, on my list of references (bibliography), I have

\hyperref{http://www.something.com/camión/ }{link}.

It does not work: neither by replacing the letter ó by its Unicode \unichar{243} nor by its mathematical accent \acute{o}… Furthermore "copy-paste" of the glyph (ó) in the LaTEX word processor produces almost the same result, i.e., the above hyperlink in

  1. PDF document, leads to the website

    http://wwwu.something.com/camión/
    
  2. DJVU document, leads to the website

    http://www.something.com/cami"strange symbol"n/
    

Please, can you suggest me a way of solving this problem?

Best Answer

You can use the UTF-8 (hex.) representation:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}

\begin{document}

\href{http://www.something.com/cami\%C3\%B3n/ }{link}

\end{document}

A site with a table to look up characters: http://www.utf8-chartable.de/

As Heiko Oberdiek mentions in his comment, the browser might help to get the correct encoded URL: you can copy&paste from the address bar or use the "Copy Link Address" facility.

Related Question