NWUXLenByteToUnicode

Converts a length-specified byte string into a Unicode string

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 <nunicode.h> 
    
   N_EXTERN_LIBRARY(nint) NWUXLenByteToUnicode ( 
      pCONVERT              byteUniHandle,  
      punicode              unicodeOutput,  
      nuint                 outputBufferLen,  
      const nuint8 N_FAR   *byteInput,  
      nuint                 inLength,  
      pnuint                actualLength);
   

Pascal Syntax

   uses netwin32 
    
   Function NWUXLenByteToUnicode 
     (byteUniHandle : pCONVERT;
     unicodeOutput : punicode;
     byteInput : const nuint8;
     inLength : nuint;
     actualLength : pnuint           
   ): nint;
   

Parameters

byteUniHandle
(IN) Points to the converter handle.
unicodeOutput
(OUT) Points to the buffer to receive the converted Unicode string (optional).
outputBufferLen
(IN) Specifies the maximum size of the output buffer in bytes (0 specifies that the buffer size is not checked).
byteInput
(IN) Points to the input buffer containing the byte string to be converted.
inLength
(IN) Specifies the length of the input string in bytes (might not be NULL-terminated).
actualLength
(OUT) Points to the returned length (in Unicode characters) of the converted string not including the NULL terminator (optional).

Return Values

0x0000

SUCCESSFUL

0xFDE9

NWU_NULL_HANDLE

0xFDEA

NWU_BAD_HANDLE

0xFDEB

NWU_HANDLE_MISMATCH

0xFDEC

NWU_UNMAPPABLE_CHAR

0xFDEE

NWU_BUFFER_FULL

Remarks

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, NWUXLenByteToUnicode converts an unmappable byte into the substitute Unicode character.

By default, NWUXLenByteToUnicode converts a special byte sequence into a Unicode character. For example, "[2620]" is converted to the single Unicode character, 0x2620.

Call NWUXLenByteToUnicode 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 NWUXLenByteToUnicode when an embedded NULL is encountered, see Length-Specified Byte String Conversion.

See exlbuni.c for sample code.

See Also

NWUXLenByteToUnicodePath, NWUXUnicodeToUntermByte