NWUnicodeToCollation

Converts a Unicode string to an array of collation weights for use in comparison operations to provide proper sorting for the current country

Local Servers:nonblocking
Remote Servers:N/A
NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows95, Windows 98
Library:Cross-Platform Localization (LOC*.*)
Service:Unicode

Syntax

   #include <unicode.h> 
    
   N_EXTERN_LIBRARY(nint) NWUnicodeToCollation ( 
      nptr                   ruleHandle,  
      punicode               dest,  
      nuint32                maxLen,  
      const unicode N_FAR   *src,  
      unicode                noMap,  
      pnuint32               len);
   

Pascal Syntax

   uses netwin32 
    
   Function NWUnicodeToCollation 
     (ruleHandle : nptr;             
      dest : punicode;           
      maxLen : nuint32;           
      src : punicode;         
      noMap : unicode;           
      len : pnuint32            
   ) : nint;
   

Parameters

ruleHandle
(IN) Points to the rule table handle for unicode-to-collation conversion.
dest
(OUT) Points to the buffer for resulting Unicode collation weights.
maxLen
(IN) Specifies the maximum number of Unicode characters in the dest parameter. The buffer is null terminated.
src
(IN) Points to the buffer with source Unicode.
noMap
(IN) Specifies no map character.
len
(OUT) Points to the number of characters copied into the dest parameter, including the 2-byte null termination character.

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

Successful

0xFE10

UNI_HANDLE_BAD

0xFE0D

UNI_NO_DEFAULT

0xFE0E

UNI_RULES_CORRUPT

0xFE0F

UNI_HANDLE_MISMATCH

Remarks

On Win32 clients, this routine calls wcsxfrm which results in some differences from other platforms. If there is insufficient space in the output buffer, Win32 clients set len = maxLen, do not null terminate the output buffer, and return status -1. Non-Win32 clients always return the number of unicode characters written into the output buffer and always null terminate.

NWUnicodeToCollation is similar to the C strxfrm.

For sample code, see Section 3.3, Example: NWGetUnicodeToCollationHandle.

See Also

NWGetCollationHandle, NWUnicodeCompare