NWLTruncateString

Truncates a string at the specified number of bytes

NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform Localization (LOC*.*)
Service:Internationalization

Syntax

  #include <nwlocale.h> 
   
  N_EXTERN_LIBRARY (nint) NWLTruncateString  ( 
     pnchar8   pStr,  
     nint      iMaxLen); 
  
  

Pascal Syntax

  uses netwin32 
   
  Function NWltoa 
    (pStr : pnchar8; 
     iMaxLen : nint 
  ) : nint; 
  
  

Parameters

pStr
(IN) Points to the first character in the string (can contain double-byte characters).
iMaxLen
(IN) Specifies the maximum length of the string, including the NULL terminator, in bytes.

Return Values

Returns the length of the string (might be truncated) not counting the NULL terminator (in bytes).

Remarks

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.