It looks like the url package does it better and I will use it but it
still places the tilde higher than the two examples I gave above.
I'm not entirely sure if this is relevant, but personally I use url.sty
with the definition
\let\UrlTildeSpecial=\relax
Then the result uses a normal typewriter ~ instead of \sim.
karl