NWLTruncateString
Truncates a string at the specified number of bytes
#include <nwlocale.h>
N_EXTERN_LIBRARY (nint) NWLTruncateString (
pnchar8 pStr,
nint iMaxLen);
uses netwin32
Function NWltoa
(pStr : pnchar8;
iMaxLen : nint
) : nint;
Returns the length of the string (might be truncated) not counting the NULL terminator (in bytes).
NWLTruncateString truncates the string if necessary so the entire string, including the NULL termination byte, will fit in a buffer of the number of bytes specified by the iMaxLen parameter.
If the truncation would chop a double-byte character in half, the first half of the double-byte character is also eliminated.