首页
社区
课程
招聘
[旧帖] [求助]API函数InternetCanonicalizeUrlA的解释 0.00雪花
发表于: 2010-9-6 19:25 1739

[旧帖] [求助]API函数InternetCanonicalizeUrlA的解释 0.00雪花

2010-9-6 19:25
1739
对于系统API函数InternetCanonicalizeUrlA实在找不到它的说明,高手求解。给出函数的说明和应用领域就可以了。谢谢。

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 59
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
应用范围应该是网络方面的!你自己看或者等高人来翻译!
我粗略看了下,下面有些简单的翻译!不知道对不对。如果有高人别笑话我
InternetCanonicalizeUrl
BOOL InternetCanonicalizeUrl(
    IN LPCSTR lpszUrl,
    OUT LPSTR lpszBuffer,
    IN OUT LPDWORD lpdwBufferLength,
    IN DWORD dwFlags
);

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

Returns TRUE if successful, or FALSE otherwise. To get extended error information, callGetLastError. Possible errors include: ERROR_BAD_PATHNAME  The URL could not be canonicalized.
ERROR_INSUFFICIENT_BUFFER  Canonicalized URL is too large to fit in the buffer provided. The *lpdwBufferLength parameter is set to the size, in bytes, of the buffer required to hold the resultant, canonicalized URL.
ERROR_INTERNET_INVALID_URL  The format of the URL is invalid.
ERROR_INVALID_PARAMETER  Bad string, buffer, buffer size, or flags parameter.

lpszUrl
Address of the input URL to canonicalize.
;一个符合规定的URL
lpszBuffer
Address of the buffer that receives the resulting canonicalized URL.
接受来自URL返回来的数据
lpdwBufferLength
Length, in bytes, of the lpszBuffer buffer. If the function succeeds, this parameter receives the length of the lpszBuffer buffer—the length does not include the terminating null. If the function fails, this parameter receives the required length, in bytes, of the lpszBuffer buffer—the required length includes the terminating null.
数据的大小
dwFlags
Flags that control canonicalization. Can be one of the following values: ICU_BROWSER_MODE  Does 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_DECODE  Converts all %XX sequences to characters, including escape sequences, before the URL is parsed.
ICU_ENCODE_SPACES_ONLY  Encodes spaces only.
ICU_NO_ENCODE  Does not convert unsafe characters to escape sequences.
ICU_NO_META  Does 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.

InternetCanonicalizeUrl always encodes by default, even if the ICU_DECODE flag has been specified. To decode without re-encoding, use ICU_DECODE | ICU_NO_ENCODE. If the ICU_DECODE flag is used without ICU_NO_ENCODE, the URL is decoded before being parsed; unsafe characters then are re-encoded after parsing. This function will handle arbitrary protocol schemes, but to do so it must make inferences from the unsafe character set.

The application calling InternetCanonicalizeUrl should track the usage of this function on a particular URL. If unsafe characters in a URL have been converted to escape sequences, using InternetCanonicalizeUrl again on the URL (with no flags) will cause the escape sequences to be converted to another escape sequence. For example, a blank space in a URL would be converted to the escape sequence "%20". Calling InternetCanonicalizeUrl again on the URL would cause the escape sequence "%20" to be converted to the escape sequence "%2520", because the "%" sign is an unsafe character that is reserved for escape sequences and is replaced by the function with the escape sequence "%25".

=========================
楼下接力
2010-9-6 21:26
0
游客
登录 | 注册 方可回帖
返回
//