NWLUnicodeToUTF8

Converts a Unicode string to UTF-8 format.

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

   N_GLOBAL_LIBRARY(nint) NWLUnicodeToUTF8 (
      punicode   uniStr,
      nuint      maxSize,
      pnuint8    utf8Str,
      pnuint     utf8Size);
   

Pascal Syntax

   uses netwin32 
    
   Function NWLUnicodeToUTF8 
     (uniStr : punicode;              
      maxSize : nuint;           
      utf8Str : pnuint8;           
      utf8Size : pnuint            
   ): nint;
   

Parameters

uniStr
(IN) Points to the Unicode-formatted string.
maxSize
(IN) Specifies the number of bytes allocated for utf8Str.
utf8Str
(OUT) Points to a buffer that holds the new UTF-8 string.
utf8Size
(OUT) Points to the length (in bytes) of the string contained in utf8Str, including the string termination character (optional).

Return Values

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

0

N_SUCCESS

-500

UNI_INSUFFICIENT_BUFFER

Remarks

For sample code, see utf8.c.

See Also

NWLUnicodeToUTF8Size, NWLUTF8ToUnicode, NWLUTF8ToUnicodeSize