Fixed copying url with special characters into clipboard.

Also properly encode url for loading in W3 validator.

Followup to #762