fix: IRI to URI conversion by aucampia · Pull Request #2304 · RDFLib/rdflib (original) (raw)

Summary of changes

The URI to IRI conversion was percentage-quoting characters that should not have been quoted, like equals in the query string. It was also not quoting things that should have been quoted, like the username and password components of a URI.

This change improves the conversion by only quoting characters that are not allowed in specific parts of the URI and quoting previously unquoted components. The safe characters for each segment are taken from RFC3986.

The new behavior is heavily inspired by
werkzeug.urls.iri_to_uri though there are some differences.

Checklist