Converts an internationalized domain name (IDN) or another internationalized label to the NamePrep form specified by Network Working Group RFC 3491, but does not perform the additional conversion to Punycode. For more information and links to related draft standards, see Handling Internationalized Domain Names (IDNs).
int IdnToNameprepUnicode(
DWORD dwFlags,
_In_reads_(cchUnicodeChar)LPCWSTR lpUnicodeCharStr,
int cchUnicodeChar,
_Out_writes_opt_(cchNameprepChar)LPWSTR lpNameprepCharStr,
int cchNameprepChar
)
dwFlags
Type: DWORD
Flags specifying conversion options. For detailed definitions, see the dwFlags parameter of IdnToAscii.
lpUnicodeCharStr
Type: In_reads(cchUnicodeChar)LPCWSTR
Pointer to a Unicode string representing an IDN or another internationalized label.
cchUnicodeChar
Type: int
Count of Unicode characters in the input Unicode string indicated by lpUnicodeCharStr.
lpNameprepCharStr
Type: Out_writes_opt(cchNameprepChar)LPWSTR
Pointer to a buffer that receives a version of the input Unicode string converted through NamePrep processing. Alternatively, the function can retrieve NULL for this parameter, if cchNameprepChar is set to 0. In this case, the function returns the size required for this buffer.
cchNameprepChar
Type: int
Size, in characters, of the buffer indicated by lpNameprepCharStr. The application can set the size to 0 to retrieve NULL in lpNameprepCharStr and have the function return the required buffer size.
Type: int
Returns the number of characters retrieved in lpNameprepCharStr if successful. The retrieved string is null-terminated only if the input Unicode string is null-terminated.
If the function succeeds and the value of cchNameprepChar is 0, the function returns the required size, in characters including a terminating null character if it was part of the input buffer.
The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one of the following error codes:
See Remarks for IdnToAscii.
Header: Declared in winnls.h.
Library: Use kernelx.lib.