![]() |
MKI_ConvertUTF16ToUTF8 (Strings) New in Version 2019.1 |
www.CAD6.com |
C++ Syntaxbool MKI_ConvertUTF16ToUTF8( const LPCWSTR f_pszSource, LPSTR f_pszDestin, const size_t f_unMaxSize );
template <size_t f_unSize> bool MKI_ConvertUTF16ToUTF8( const LPCWSTR f_pszSource, char (&f_rDestin)[f_unSize] )
bool MKI_ConvertUTF16ToUTF8( const LPCWSTR f_pszSource, const size_t f_unCharNum, LPSTR f_pszDestin, const size_t f_unMaxSize );
template <size_t f_unSize> bool MKI_ConvertUTF16ToUTF8( const LPCWSTR f_pszSource, const size_t f_unCharNum, char (&f_rDestin)[f_unSize] )
Converts a UTF-16 Unicode text to a UTF-8 Unicode text.
ParametersSource [const LPCWSTR] Address of the source UTF-16 text. CharNum [const size_t] Maximum number of characters of the source text to convert (not including any terminating '\0' character). If CharNum is not stated or the source text is shorter, it will be converted completely. Destin [LPSTR] Pointer to or [char[]&] Reference to a UTF-8 string that shall receive the converted text with a fixed maximum length. MaxSize [const size_t] Maximum allowed length of the destination text in UTF-8 characters including the terminating '\0' character.
Return ValueReturns true if the conversion was successful and the resulting string fit into the buffer. If false is returned since the buffer was too small, as many characters as possible were already converted and terminated by a '\0' character.
CommentThe resulting text will always be terminated with a '\0' character if the buffer size is at least 1, even if false is returned! The text may, however, be truncated.
|
CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH