'Encodes the URL to a tuple made out of bytes.  The charset is
only being used for the path, query and fragment.'

def encode(self, charset='utf-8', errors='replace'):

    return BytesURL(self.scheme.encode('ascii'), self.encode_netloc(), self.path.encode(charset, errors), self.query.encode(charset, errors), self.fragment.encode(charset, errors))
