win32inet.InternetCanonicalizeUrl

string = InternetCanonicalizeUrl(url, flags )

Canonicalizes a URL, which includes converting unsafe characters and spaces into escape sequences.

Parameters

url : string

The URL to canonicalize.

flags=0 : int

integer value that contains the flags that control canonicalization. This can be one of the following values:

ICU_BROWSER_MODEDoes not encode or decode characters after "#" or "?", and does not remove trailing white space after "?". If this value is not specified, the entire URL is encoded and trailing white space is removed. ICU_DECODEConverts all %XX sequences to characters, including escape sequences, before the URL is parsed. ICU_ENCODE_PERCENTEncodes any percent signs encountered. By default, percent signs are not encoded. This value is available in Microsoft® Internet Explorer 5 and later versions of the Win32® Internet functions. ICU_ENCODE_SPACES_ONLYEncodes spaces only. ICU_NO_ENCODEDoes not convert unsafe characters to escape sequences. ICU_NO_METADoes not remove meta sequences (such as "." and "..") from the URL. If no flags are specified (dwFlags = 0), the function converts all unsafe characters and meta sequences (such as .,\\ .., and ...) to escape sequences.