3

I am trying to make names with special Danish characters in email addresses look right in the email the address in a hyperref link in the document compiled to PDF. I have attempted:

\documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[unicode]{hyperref} \begin{document} \href{mailto:Ole-Bent Kjær <[email protected]>}{some.address}@some.domain.dk \end{document} 

I found and tried this answer: https://stackoverflow.com/a/4697003/865169 and this: https://tex.stackexchange.com/a/111796/13780 to fix it, with no luck. The link in the resulting PDF file turns out mailto:Ole-Bent Kj\T1\ae r <[email protected]>. Is this a PDF problem that I cannot solve from LaTeX?

1
  • I don't think the issue here is mailto: as you see the same with æ (or \ae) in a standard link. I suspect that only some chars can be handled by the unicode option within hyperlinks (although the same char seems to be fine in the TOC bookmarks). I can't find any comment on the coverage in the docs, so I guess we need Heiko to answer! Commented Sep 16, 2014 at 10:32

1 Answer 1

4

As mailto: is a URI scheme, the rules for handling special characters are identical to those for URLs, which themselves also are URIs. Therefore one can use the so-called percent-encoding, which substitutes special characters by sequences of a percent sign followed by its UTF-8 byte sequence. For æ, this byte sequence is C3 A6, therefore its percent encoding would be %C3%A6. But as LaTeX takes the percent sign for the beginning of a comment, one has to escape it with a backslash, as well. After these steps, the result is the following:

\href{mailto:Ole-Bent Kj\%C3\%A6r <[email protected]>}{some.address}@some.domain.dk 

Now, if the link is hovered over or clicked, the correct æ will show instead of \%C3\%A6.

See also here: Hyperref: Scandinavian characters (æø) don't work in \url, hyperlink is wrong

3
  • Actually it even works without escaping the percent signs, i. e., Kj%C3%A6r is also an option. Commented Sep 16, 2014 at 10:35
  • This sort of works for me; in my example, the link says "mailto:Ole-Bent Kj%C3%A6r <[email protected]>" when hovered in the PDF, but it does get translated to "æ" in the email client when clicked. Maybe this is an issue with the PDF viewer (evince)? Commented Sep 17, 2014 at 9:53
  • I only tried Adobe’s own reader, so you might be right about that. Commented Sep 27, 2014 at 11:31

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.