| FileEncodingDetect Method (String, Encoding, String, Boolean) |
Is used for code page detection. First, the file is searched for a BOM. If a BOM exists
and points to UNICODE, the appropriate code page is returned with the level Certain.
Otherwise, the encoding tools are used to return the code page with the level Likely.
Namespace: Sdl.FileTypeSupport.Framework.Core.UtilitiesAssembly: Sdl.FileTypeSupport.Framework.Core.Utilities (in Sdl.FileTypeSupport.Framework.Core.Utilities.dll) Version: 1.0.0.0 (1.0.2551.0)
Syntaxpublic static Pair<Codepage, DetectionLevel> Detect(
string FilePath,
Encoding suggestedEncoding,
out string lineBreakType,
out bool hasUTF8BOM
)
Public Shared Function Detect (
FilePath As String,
suggestedEncoding As Encoding,
<OutAttribute> ByRef lineBreakType As String,
<OutAttribute> ByRef hasUTF8BOM As Boolean
) As Pair(Of Codepage, DetectionLevel)
public:
static Pair<Codepage^, DetectionLevel>^ Detect(
String^ FilePath,
Encoding^ suggestedEncoding,
[OutAttribute] String^% lineBreakType,
[OutAttribute] bool% hasUTF8BOM
)
static member Detect :
FilePath : string *
suggestedEncoding : Encoding *
lineBreakType : string byref *
hasUTF8BOM : bool byref -> Pair<Codepage, DetectionLevel>
Parameters
- FilePath
- Type: SystemString
Path to file for code page detection - suggestedEncoding
- Type: System.TextEncoding
A suggested codepage that may be used if it is a valid option. - lineBreakType
- Type: SystemString
String for the line break type. - hasUTF8BOM
- Type: SystemBoolean
bool to indicate if UTF-8 BOM present
Return Value
Type:
PairCodepage,
DetectionLevel
A Pair container that holds the detected codepage and the information on how likely it is to be the correct one.
See Also
Comments