L_OcrEncoding_ToUTF8

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrEncoding_ToUTF8(source, sourceCount, dest, destCount)

const L_WCHAR* source; pointer to the Unicode string to convert
L_UINT sourceCount; size, in characters, of the string indicated by 'source'
L_CHAR* dest; pointer to a buffer that receives the converted string
L_UINT destCount; size, in bytes, of the buffer indicated by 'dest'

Maps a UTF-16 (wide character) string to a new character string. The new character string is not necessarily from a multibyte character set.

Parameter Description
source Pointer to the Unicode string to convert.
sourceCount Size, in characters, of the string indicated by 'source'.
dest Pointer to a buffer that receives the converted string.
destCount Size, in bytes, of the buffer indicated by 'dest'.

Returns

SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Maps a UTF-16 (wide character) string to a new character string. The new character string is not necessarily from a multibyte character set.

This function internally calls WideCharToMultiByte function to do the conversion, so for more information about this function, refer to MSDN.

Required DLLs and Libraries

LTOCR
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
See Also
Functions: L_OcrEncoding_FromUTF8
Topics: Programming with LEADTOOLS OCR Module - LEAD Engine
Starting and Shutting Down the OCR Engine

Example

// This example shows how to map a UTF-16 (wide character) string to a new character string.  
// The new character string is not necessarily from a multi-byte character set. 
L_INT L_OcrEncoding_ToUTF8Example(const L_WCHAR* source, L_UINT sourceCount, L_CHAR* dest, L_UINT destCount) 
{ 
   L_OcrEncoding_ToUTF8(source, sourceCount, dest, destCount); 
   return SUCCESS; 
} 

Help Version 20.0.2018.1.19
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS OCR Module - LEAD Engine C API Help