Fixed parse_url

When URL receive in parse_url method with spaces or other things get a raise error (Bad URL), so I do fixed with URI.encode.