C# 클래스 MarkDownEditor.SimpleHelpers.FileEncoding

파일 보기 프로젝트 열기: chenguanzhou/MarkDownEditor 1 사용 예제들

공개 메소드들

메소드 설명
CheckForTextualData ( byte rawData ) : bool

Detects if contains textual data.

CheckForTextualData ( byte rawData, int start, int count ) : bool

Detects if contains textual data.

Complete ( ) : Encoding

Finalize detection phase and gets detected encoding name.

Detect ( Stream inputData ) : string

Detects the encoding of textual data of the specified input data. Only the stream first 20Mb will be analysed.

Detect ( Stream inputData, int maxSize, int bufferSize = 16*1024 ) : string

Detects the encoding of textual data of the specified input data.

Detect ( byte inputData, int start, int count ) : string

Detects the encoding of textual data of the specified input data.

DetectFileEncoding ( Stream inputStream, Encoding defaultIfNotDetected = null ) : Encoding

Tries to detect the file encoding.

DetectFileEncoding ( byte inputData, int start, int count, Encoding defaultIfNotDetected = null ) : Encoding

Tries to detect the file encoding.

DetectFileEncoding ( string inputFilename, Encoding defaultIfNotDetected = null ) : Encoding

Tries to detect the file encoding.

Reset ( ) : void

Resets this instance.

TryLoadFile ( string filename, string defaultValue = "" ) : string

Tries to load file content with the correct encoding.

비공개 메소드들

메소드 설명
CheckForByteOrderMark ( byte rawData, int start ) : bool

Detects if data has bytes order mark to indicate its encoding for textual data.

GetCurrentEncoding ( ) : string
IncrementFrequency ( string charset ) : void

메소드 상세

CheckForTextualData() 공개 정적인 메소드

Detects if contains textual data.
public static CheckForTextualData ( byte rawData ) : bool
rawData byte The raw data.
리턴 bool

CheckForTextualData() 공개 정적인 메소드

Detects if contains textual data.
public static CheckForTextualData ( byte rawData, int start, int count ) : bool
rawData byte The raw data.
start int The start.
count int The count.
리턴 bool

Complete() 공개 메소드

Finalize detection phase and gets detected encoding name.
public Complete ( ) : Encoding
리턴 System.Text.Encoding

Detect() 공개 메소드

Detects the encoding of textual data of the specified input data. Only the stream first 20Mb will be analysed.
public Detect ( Stream inputData ) : string
inputData Stream The input data.
리턴 string

Detect() 공개 메소드

Detects the encoding of textual data of the specified input data.
bufferSize parameter cannot be 0 or less.
public Detect ( Stream inputData, int maxSize, int bufferSize = 16*1024 ) : string
inputData Stream The input data.
maxSize int Size in byte of analysed data, if you want to analysed only a sample. Use 0 to read all stream data.
bufferSize int Size of the buffer for the stream read.
리턴 string

Detect() 공개 메소드

Detects the encoding of textual data of the specified input data.
public Detect ( byte inputData, int start, int count ) : string
inputData byte The input data.
start int The start.
count int The count.
리턴 string

DetectFileEncoding() 공개 정적인 메소드

Tries to detect the file encoding.
public static DetectFileEncoding ( Stream inputStream, Encoding defaultIfNotDetected = null ) : Encoding
inputStream Stream The input stream.
defaultIfNotDetected System.Text.Encoding The default encoding if none was detected.
리턴 System.Text.Encoding

DetectFileEncoding() 공개 정적인 메소드

Tries to detect the file encoding.
public static DetectFileEncoding ( byte inputData, int start, int count, Encoding defaultIfNotDetected = null ) : Encoding
inputData byte The input data.
start int The start.
count int The count.
defaultIfNotDetected System.Text.Encoding The default encoding if none was detected.
리턴 System.Text.Encoding

DetectFileEncoding() 공개 정적인 메소드

Tries to detect the file encoding.
public static DetectFileEncoding ( string inputFilename, Encoding defaultIfNotDetected = null ) : Encoding
inputFilename string The input filename.
defaultIfNotDetected System.Text.Encoding The default encoding if none was detected.
리턴 System.Text.Encoding

Reset() 공개 메소드

Resets this instance.
public Reset ( ) : void
리턴 void

TryLoadFile() 공개 정적인 메소드

Tries to load file content with the correct encoding.
public static TryLoadFile ( string filename, string defaultValue = "" ) : string
filename string The filename.
defaultValue string The default value if unable to load file content.
리턴 string