Hunny Software Library Reference

Text.UnicodeText Property

Gets or sets the text as a Unicode string.

[Visual Basic]
Public Property UnicodeText As String
[C#]
public string UnicodeText {get; set;}

Property Value

The string representation as a Unicode string.

Remarks

This convenience property gets or sets the text as a Unicode string.

When getting the text, the library decodes all the encoded words and converts all the characters to Unicode characters.

When setting the text, the library creates and adds encoded words to the Text object. If all the characters in the Unicode string have code points less than 128 (that is, ASCII characters), then the library adds the string unchanged -- no encoded words are created. Otherwise, if all the characters have code points less than 256, then the library creates encoded words that contain ISO-8859-1 characters encoded with the Q transfer encoding. If there are any characters that have code points greater than or equal to 256, then the library encodes the characters with the UTF-8 encoding and creates encoded words with either the B or Q transfer encoding, whichever yields the shortest length.

If you require an encoding other than ISO-8859-1 or UTF-8, then you may use the method SetUnicodeText(), which allows you to specify a particular encoding.

Setting this property sets the is-modified flag.

Exceptions

Exception TypeCondition
NotSupportedExceptionOne of the encoded words uses an encoding that the CLR does not support.

See Also

Text Class | Hunny.Mime Namespace