LdapUnicodeToUTF8 function (winldap.h)

The LdapUnicodeToUTF8 function converts Unicode strings to UTF-8. Modules that do not have the UTF-8 code page can call this function.

Syntax

int LDAPAPI LdapUnicodeToUTF8(
  [in]  LPCWSTR lpSrcStr,
  [in]  int     cchSrc,
  [out] LPSTR   lpDestStr,
  [in]  int     cchDest
);

Parameters

[in] lpSrcStr

A pointer to a null-terminated Unicode string to convert.

[in] cchSrc

An integer that specifies the size, in characters, of the lpSrcStr string.

[out] lpDestStr

A pointer to a buffer that receives the converted UTF-8 character string, without a null terminator.

[in] cchDest

An integer that specifies the size, in characters, of the lpDestStr buffer.

Return value

The return value is the size, in characters, written to the lpDestStr buffer. If the lpDestStr buffer is too small, GetLastError returns ERROR_INSUFFICIENT_BUFFER.

When the cchDest parameter is zero, the required size of the destination buffer is returned.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header winldap.h
Library Wldap32.lib
DLL Wldap32.dll

See also

Functions

LdapUTF8ToUnicode