Parses a URI string into a new Uri object.
Will return NULL if the URI cannot be parsed. This is identical to from_string except that the userinfo and fragment components of the URI will not be unescaped while parsing.
Use this when you need to extract a username and password from the userinfo such as https://user:passwordexample.com
since
either may contain a URI-escaped ':' character. from_string will unescape the entire
userinfo component, which will make it impossible to know which ':' delineates the username and password.
The same applies to the fragment component of the URI, such as https://example.com/path#fragment which may contain a URI-escaped '#'.
uri |
The URI string to parse. |
A new Uri object, or NULL. |