TryDetectEncodingFromBOM Method
Tries to detect the encoding of the given data by looking at the Byte Order Mask (if any) the given data starts with and returns true on success.
'Declaration
Public Shared Function TryDetectEncodingFromBOM( _
ByVal () As System.Byte, _
ByRef As System.Integer, _
ByRef As NEncoding _
) As System.Boolean
'Usage
Dim data() As System.Byte
Dim offset As System.Integer
Dim encoding As NEncoding
Dim value As System.Boolean
value = NStreamHelpers.TryDetectEncodingFromBOM(data, offset, encoding)
public static System.bool TryDetectEncodingFromBOM(
System.byte[] ,
out System.int ,
out NEncoding
)
Parameters
- data
- offset
- encoding
- The detected encoding.
Return Value
True if the encoding has been detected.
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)