Nevron Open Vision Documentation
Nevron.Nov.IO Namespace / NStreamHelpers Class / TryDetectEncodingFromBOM Method
The detected encoding.


In This Topic
    TryDetectEncodingFromBOM Method
    In This Topic
    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.
    Syntax
    'Declaration
     
    
    Public Shared Function TryDetectEncodingFromBOM( _
       ByVal data() As System.Byte, _
       ByRef offset As System.Integer, _
       ByRef encoding 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[] data,
       out System.int offset,
       out NEncoding encoding
    )

    Parameters

    data
    offset
    encoding
    The detected encoding.

    Return Value

    True if the encoding has been detected.
    Requirements

    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)

    See Also