UTF8Encoding: GetPreamble

GetPreamble

Returns an array of bytes that represents this encoding.



 Public Function GetPreamble ( ) As Byte ( )

Return Values

Byte() -  A byte array containg the bytes to be used to identify this encoding type.

Remarks

If the encoding was created setting the ShouldEmitUTF8Identifier paramter to true, then this will return the UTF-8 identifer &HFFEF already encoded into the 3 bytes. The bytes are &HEF, &HBB, &HBF. They will decode to &HFFEF. Since &HFF and &HFE are not valid in a UTF-8 encoding, these will unique and can be used to identify the encoding used in the stream.

If ShouldEmitUTF8Identifier was set to False, then an empty array will be returned. The array will not be null. It will have a UBound of -1.

See Also

Project VBCorLib Overview Class UTF8Encoding Overview UTF8Encoding Properties UTF8Encoding Methods GetMaxCharCount GetString