afc: Normalize URL better
According to RFC 1738 there's additional unsafe characters, such as curly brackets, pipe, quotes, etc that are disallowed for host names.
Just filter all non-word characters to avoid them slipping in.
I don't fully understand why the fallback doesn't work in the bug report but this should make cases like apostrophes work.
Any non-Latin1 character is replaced by a question mark "?"
by toLatin1
, so those are also filtered this way.
The underscore used as replacement for space is preserved by this regex.
Edited by ivan tkachenko