Group: Shell Lightweight Utility APIs -- Path Functions - Library: shlwapi
Converts characters in a URL that might be altered during transport across the Internet ("unsafe" characters) into their corresponding escape sequences.
Converting characters in a URL into corresponding escape sequences and backwards
HRESULT UrlEscape(
LPCTSTR pszURL,
LPTSTR pszEscaped,
LPDWORD pcchEscaped,
DWORD dwFlags
);
DECLARE INTEGER UrlEscape IN shlwapi;
STRING pszURL, STRING @pszEscaped,;
INTEGER @pcchEscaped, INTEGER dwFlags
pszURL [in] Null-terminated string of maximum length INTERNET_MAX_URL_LENGTH that contains a full or partial URL.
pszEscaped [out] Buffer that receives the converted string, with the unsafe characters converted to their escape sequences.
pcchEscaped [in, out] Pointer to a DWORD value containing the number of characters in the pszEscaped buffer.
dwFlags [in] Flags that indicate which portion of the URL is being provided in pszURL and which characters in that string should be converted to their escape sequences.
Returns S_OK (0) if successful.
See UrlUnescape and InternetCanonicalizeUrl functions.