CreateUriFromMultiByteString function
Converts an ANSI URL with components in various multibyte character set (MBCS) encodings to an IUri object.
Syntax
HRESULT CreateUriFromMultiByteString( _In_ LPCSTR pszANSIInputUri, _In_ DWORD dwEncodingFlags = Uri_ENCODING_USER_INFO_AND_PATH_IS_PERCENT_ENCODED_UTF8, _In_ DWORD dwCodePage, _In_ DWORD dwCreateFlags, _Reserved_ DWORD_PTR dwReserved, _Out_ IUri **ppURI );
Parameters
- pszANSIInputUri [in]
-
A constant pointer to an ANSI character string that specifies the URI.
- dwEncodingFlags [in]
-
A valid combination of the following flags, which allows the caller to specify the encoding of all applicable components, except the scheme and the port.
Uri_ENCODING_USER_INFO_AND_PATH_IS_PERCENT_ENCODED_UTF8 (0x00000001)
-
Default. The user info component and path component use percent encoded UTF-8.
-
The user info component and path component use the codepage specified in dwCodePage.
-
Default. The host component uses IDN (Punycode) format.
-
The host component uses percent encoded UTF-8.
-
The host component uses the codepage specified in dwCodePage.
Uri_ENCODING_QUERY_AND_FRAGMENT_IS_PERCENT_ENCODED_UTF8 (0x00000020)
-
Default. The query and fragment components use percent encoded UTF-8.
-
The query and fragment components use the codepage specified in dwCodePage.
-
The URI meets the requirements of RFC 3490. This flag combines the preceding default flags: Uri_ENCODING_HOST_IS_IDN, Uri_ENCODING_USER_INFO_AND_PATH_IS_PERCENT_ENCODED_UTF8, and Uri_ENCODING_QUERY_AND_FRAGMENT_IS_PERCENT_ENCODED_UTF8.
- dwCodePage [in]
-
An unsigned long integer value that contains the codepage identifier value for the multibyte URI.
- dwCreateFlags [in]
-
A valid combination of flags. Refer to CreateUri for a complete list of flags and values.
- dwReserved [in]
-
Reserved. Must be set to 0.
- ppURI [out]
-
An IUri interface pointer that will receive the new instance.
Return value
Returns one of the following values.
| Return code | Description |
|---|---|
|
Success. |
|
Flags conflict, or ppURI is NULL. |
|
There is insufficient memory to create the IUri. |
|
The string does not contain a recognized URI format. |
|
The URI contains syntax that attempts to bypass security. |
Remarks
This function fails with E_INVALIDARG, if the flags specified in dwEncodingFlags conflict. For example, if both Uri_ENCODING_HOST_IS_PERCENT_ENCODED_UTF8 and Uri_ENCODING_HOST_IS_PERCENT_ENCODED_CP are set, this function will fail.
The dwEncodingFlags for host are ignored if Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES is specified in dwCreateFlags. Use the encoding flags for userinfo and path instead.
Requirements
|
Minimum supported client |
Windows XP with SP2 |
|---|---|
|
Minimum supported server |
Windows Server 2003 with SP1 |
|
Product |
Internet Explorer 7 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- Reference
- CreateUri
- CreateUriWithFragment