![]() |
MKI_ConvertAnsiToUTF16 (Strings) New in Version 2019.1 |
www.CAD6.com |
C++ Syntaxbool MKI_ConvertAnsiToUTF16( const LPCSTR f_pszSource, LPWSTR f_pszDestin, const size_t f_unMaxSize );
template <size_t f_unSize> bool MKI_ConvertAnsiToUTF16( const LPCSTR f_pszSource, wchar_t (&f_rDestin)[f_unSize] );
bool MKI_ConvertAnsiToUTF16( const LPCSTR f_pszSource, const size_t f_unCharNum, LPWSTR f_pszDestin, const size_t f_unMaxSize );
template <size_t f_unSize> bool MKI_ConvertAnsiToUTF16( const LPCSTR f_pszSource, const size_t f_unCharNum, wchar_t (&f_rDestin)[f_unSize] );
Converts an Ansi text without Unicode encoding to a UTF-16 Unicode text.
ParametersSource [const LPCSTR] Address of the source Ansi text. It may contain HTML-style Unicode character definitions in the &#xxx; form. 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 [LPWSTR] Pointer to or [wchar_t[]&] Reference to a UTF-16 character 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-16 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