Canonicalize a URL. Usage:
Returns a copy of
url, canonicalized according to
flags, which are zero or more of:
Lower-cases the protocol.
Lower-cases the hostname.
Removes trailing dot(s) in hostname.
Reverse the host/domains in the hostname. E.g.
http://gov.bar.foo/". This can be used to put the
most-significant part of the hostname leftmost.
Remove the port number if it is the standard port for the protocol.
URL-decode safe bytes, where semantics are unlikely to change.
%41" becomes "
A", but "
remains encoded, because it would decode to "
Upper-case the hex characters of encoded bytes.
Lower-case the (non-encoded) characters in the path. May be used for URLs known to point to case-insensitive filesystems, e.g. Windows.
Adds a trailing slash to the path, if no path is present.
Default flags are all but
flag may be prefixed with the operator
+ to append the flag to
- to remove the flag from existing flags; or
= (default) to clear existing flags first and then set the
flag. Operators remain in effect for subsequent flags until the next
operator (if any) is used. Function added in Texis version 7.05.