rtsp-rs
rtsp-rs copied to clipboard
Add support for setting request URIs from IRIs
The specification states that while the syntax of a request URI must strictly be a URI, users should be able to specify a IRI and have it be converted to a URI. This conversion would be the one specified in RFC3987 which essentially comes down to encoding non-ASCII characters with UTF-8 using percent encoding for each byte.
This will most likely be a separate crate like uriparse but instead called iriparse. Unfortunately, the design is a bit more subtle due to things like BIDI. There's also a question of performance as ideally the IRI would be parsed and validated in a single pass like uriparse does it, but this involves having to manually handle the various possible encodings of UCS/Unicode characters (e.g. UTF-8, UTF-16, etc.) allowed by RFC3987.