Hunny Software Library Reference

ByteString Constructor (String, String)

Initializes the new instance from a string, with a specified encoding.

[Visual Basic]
Overloads Public Sub New( _
   ByVal str As String, _
   ByVal charset As String _
)
[C#]
public ByteString(
   string str,
   string charset
);

Parameters

str
string value
charset
character encoding for converting to bytes

Remarks

This constructor converts the text of its string argument to bytes according to the the specified character encoding. The name of the character encoding should be one that is recognized by the .NET Framework Class Library's System.Text.Encoding.GetEncoding() method. Typically, the character encoding is specified using a registered charset identifier.

Exceptions

Exception TypeCondition
NotSupportedException the charset identifier is not recognized as a supported character encoding

See Also

ByteString Class | Hunny.Base Namespace | ByteString Constructor Overload List