MKI_FileUnbufferedWriteAsUTF8 (File I/O) New in Version 2019.1

www.CAD6.com

C++ Syntax

__int32

MKI_FileUnbufferedWriteAsUTF8(

 HANDLE f_hFileHandle,

 const LPCWSTR f_pszText );

 

__int32

MKI_FileUnbufferedWriteAsUTF8(

 HANDLE f_hFileHandle,

 const LPCWSTR f_pszText,

 const size_t f_unLength );

 

Converts a UTF-16 string to UTF-8 and writes the UTF-8 data directly to a file opened for write access.

 

This procedure does not support the additional disk write cache, i.e. it may not be used after calling either MKI_FileWriteInitNull, MKI_FileWriteInitDisk or MKI_FileWriteInitMemory!

 

Parameters

FileHandle

[HANDLE] File handle of a file open for write access.

Text

[const LPCWSTR] Address of UTF-16 string to be converted to UTF-8 and then written to the file.

Length

[const size_t] Optional number of UTF-16 characters in the string to be converted to UTF-8 and then written to the file. Must not exceed the number of characters in Text!

 

Return Value

Returns the number of bytes written to the file. Based on the nature of the UTF-16 to UTF-8 conversion, the resulting number of bytes written should be at least the input string length (or Length) and at most two times the input string length (or Length * 2).

 

If the return value is negative, an error has occurred (usually indicating that the drive is full).

 

CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH