NWUXLenByteToUnicodePath
Converts a length-specified file path byte string into a Unicode string
#include <nunicode.h> N_EXTERN_LIBRARY(nint) NWUXLenByteToUnicode ( pCONVERT byteUniHandle, punicode unicodeOutput, nuint outputBufferLen, const nuint8 N_FAR *byteInput, nuint inLength, pnuint actualLength);
uses netwin32 Function NWUXLenByteToUnicode (byteUniHandle : pCONVERT; unicodeOutput : punicode; outputBufferLen : nuint; byteInput : const nuint8; inLength : nuint; actualLength : pnuint ): nint;
When you want to convert a file path, call NWUXLenByteToUnicodePath rather than the NWUXLenByteToUnicode function.
Passing a zero to the outputBufferLen parameter specifies that the size of the output buffer is not checked. It is the responsibility of the caller to assure a sufficient output buffer size.
If NWU_UNMAPPABLE_CHAR is returned, the buffer is not filled past the unmappable character, but is valid up to that character.
By default, NWUXLenByteToUnicodePath converts an unmappable byte into the substitute Unicode character.
By default, NWUXLenByteToUnicodePath converts a special byte sequence into a Unicode character. For example, "[2620]" is converted to the single Unicode character, 0x2620.
Call NWUXLenByteToUnicodePath to determine the size of the string before it is converted by setting the unicodeOutput parameter to NULL. The outputBufferLen parameter will be ignored, a converted string will not be returned, and the length of the string if it were converted will be returned in the actualLength parameter.
To determine the behavior of NWUXLenByteToUnicodePath when an embedded NULL is encountered, see Length-Specified Byte String Conversion.
See exlbunip.c for sample code.