This does seem like a weird bug -- but what's the use case? I don't think the url spec (http://www.faqs.org/rfcs/rfc3986.html) actually allows them there.
Is it used to figure out how much to auto link, for example, in a comment in HN or this very forum? That's certainly a valid usecase.