Hunny Mail++ functions that accept Unicode text, such as those that accept an IMAP4 mailbox name, require the UTF-8 encoding. Since it is common for Windows applications to represent text in the UTF-16 encoding, the Hunny Mail++ library provides the UTF8 class so that developers can easily convert between UTF-8 and UTF-16.
To understand the naming of the member functions, you should understand the underlying model. In the underlying model, applications process text in the UTF-16 encoding. Therefore, UTF-16 text is considered decoded text. UTF-8 text is considered encoded text.
Static Public Member Functions | |
| size_t | EncodeLen (const uint16_t *utf16, size_t utf16Len) |
| Gets the length of the UTF-8 string that would result from encoding the UTF-16 string. | |
| size_t | Encode (const uint16_t *utf16, size_t utf16Len, char *utf8, size_t utf8MaxLen) |
| Converts a UTF-16 string to UTF-8. | |
| size_t | DecodeLen (const char *utf8, size_t utf8Len) |
| Gets the length of the UTF-16 string that would result from decoding the UTF-8 string. | |
| size_t | Decode (const char *utf8, size_t utf8Len, uint16_t *utf16, size_t utf16MaxLen) |
| Converts a UTF-8 string to UTF-16. | |
|
||||||||||||||||||||
|
Converts a UTF-8 string to UTF-16.
|
|
||||||||||||
|
Gets the length of the UTF-16 string that would result from decoding the UTF-8 string. You may use this function to determine the required length of the array you need for the UTF-16 string. The return value is the length of the UTF-16 string in (16-bit) characters.
|
|
||||||||||||||||||||
|
Converts a UTF-16 string to UTF-8.
|
|
||||||||||||
|
Gets the length of the UTF-8 string that would result from encoding the UTF-16 string. You may use this function to determine the required length of the array you need for the UTF-8 string. The return value is the length of the UTF-8 string in bytes.
|
Copyright © 2001-2005 Hunny Software, Inc. All rights reserved.