# Opening a PDF URL with tilde character link using Google Chrome [closed]

I am using hyperref to create an url with tilde character link in a pdf document, as shown below:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\url{http://lyle.smu.edu/~tspell/jaws}
\end{document}


Clicking on it, with Acrobat Reader, works fine for Firefox and IE but it doesn't for Google Chrome.

In the address bar/line in Google Chrome appears lyle.smu.edu/%257Etspell/jaws instead.

The url is shown correctly if I copy and paste it from Acrobat Reader manually into Google Chrome’s address line, but it doesn't open. It only opens in Google Chrome if I type it directly in the address line.

I've chosen to open Google Chrome as my predetermined navigator, when asked by the navigator.

Any help to make it work on both Google Chrome and the others?

-

## closed as too localized by Speravir, cyberSingularity, Stefan Kottwitz♦Jan 16 '13 at 19:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

By clicking the default browser will be opened. Just for clarification: Did you change the default browser to G. Chrome, and if yes, how? What is shown in the address bar/line or whatever it is called in G. Chrome? What happens if you copy the url and paste it manually into Chrome’s address line? (And as I already said: Don’t be astonished, if this would be closed as off-topic). –  Speravir Jan 15 '13 at 2:45
Hmm, usually the tilde is “0x7e”, what would be %7E then, but I do not know, where the “25” comes from. –  Speravir Jan 15 '13 at 3:40
@Speravir: %25 is an encoded % character. Something is being encoded twice here. –  You Jan 15 '13 at 3:53

The following document generates some URLs, with and without percent encoding:

\pdfobjcompresslevel=0
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\url{http://lyle.smu.edu/~tspell/jaws}

\href{http://lyle.smu.edu/\%7Etspell/jaws}{%
}

\url{http://lyle.smu.edu/%7Etspell/jaws}

\end{document}


The PDF file contains:

3 0 obj <<
/Type /Annot
/Border[0 0 1]/H/I/C[0 1 1]
/Rect [147.716 654.025 317.079 665.15]
>> endobj
4 0 obj <<
/Type /Annot
/Border[0 0 1]/H/I/C[0 1 1]
/Rect [147.716 642.07 317.079 653.195]
>> endobj
5 0 obj <<
/Type /Annot
/Border[0 0 1]/H/I/C[0 1 1]
/Rect [147.716 630.115 327.54 641.24]
>> endobj


The tilde ~ is an unreserved character (RFC 3986) and do not need percent encoding. Thus the second and third URLs are just for testing.

The URLs work (opening firefox with the correct URL) for the following PDF viewers:

• xpdf 3.00
• AR5/Linux
• AR7/Linux
• AR8/Linux
However, AR11/Win seems to convert the tilde to percent encoding %7E and to apply the percent encoding again, resulting in the wrong %257E. Therefore it looks like a bug in AR11/Win. Since also the percent encoded URL does not work, I do not know a workaround except using a service like tinyurl to avoid ~ (or other problematic characters).