MKI_ConvertTaggedUTF16ToUTF16 (Strings) New in Version 2024.1

www.CAD6.com

C++ Syntax

bool

MKI_ConvertTaggedUTF16ToUTF16(

 const LPCWSTR f_pszSource,

 LPWSTR f_pszDestin,

 const size_t f_unMaxSize );

 

 template <size_t f_unSize> bool

 MKI_ConvertTaggedUTF16ToUTF16(

         const LPCWSTR f_pszSource,

         wchar_t (&f_rDestin)[f_unSize] );

 

bool

MKI_ConvertTaggedUTF16ToUTF16(

 const LPCWSTR f_pszSource,

 const size_t f_unCharNum,

 LPWSTR f_pszDestin,

 const size_t f_unMaxSize );

 

 template <size_t f_unSize> bool

 MKI_ConvertTaggedUTF16ToUTF16(

         const LPCWSTR f_pszSource,

         const size_t f_unCharNum,

         wchar_t (&f_rDestin)[f_unSize] );

 

Converts a UTF-16 text with Unicode encoding to a plain UTF-16 Unicode text.

 

Please note that using Unicode characters in the range above 0x0000ffff can result in unexpected behavior since texts are always parsed one character at a time.

 

Parameters

Source

[const LPCWSTR] Address of the source UTF-16 text which 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 Value

Returns 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.

 

Comment

The 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