NWUnicodeToLocal
Converts a Unicode character string to local (code page based) character string
#include <unicode.h> N_EXTERN_LIBRARY (nint) NWUnicodeToLocal ( nptr ruleHandle, pnuint8 dest, size_t maxLen, const unicode N_FAR *src, nuint8 noMap, size_t N_FAR *len, nuint32 allowNoMapFlag);
uses netwin32 Function NWUnicodeToLocal (ruleHandle : nptr; dest : nptr; maxLen : nuint32; src : punicode; noMap : nuint8; len : pnuint; allowNoMapFlag : nuint32 (*optional, available on NLM only*) );
These are common return values; see Return Values (Return Values for C) for more information.
For cross-platform operations, NWUnicodeToLocal uses only the first six parameters. The seventh parameter is optionally available only for NLM applications.
On Win32 clients, this routine calls WideCharToMultiByte which results in some differences from other platforms. If there is insufficient space in the output buffer, Win32 clients set len to zero and do not null terminate the buffer. Non-Win32 clients always return the number of bytes written into the output buffer and always null terminate.
If the noMap character is zero and an unmappable character is encountered, Win32 clients use the system default substitution character. Non-Win32 clients use the default character contained in the rule table. If the rule table has no default, then error code UNI_NO_DEFAULT is returned.
The allowNoMapFlag parameter provides another optional behavior, but only for the NLM platform (N_PLAT_NLM must be defined). By default, on NLM applications NWUnicodeToLocal handles unmappable characters in the same way as non-Win32 clients described above. To specify behavior explicitly, define EXCLUDE_UNICODE_NLM_COMPATIBILITY_MACROS and pass one of the following values for allowNoMapFlag:
For sample code, see