Detects the code page of the given stream.
Syntax
HRESULT DetectCodepageInIStream( DWORD dwFlag, DWORD dwPrefWinCodePage, Istream *pstmIn, DetectEncodingInfo *lpEncoding, INT *pnScores, );
Parameters
- dwFlag
- [in] One of the MLDETECTCP-defined bit flag values that specify the type of incoming source text. Setting the bit flags helps the detection engines produce more accurate results.
- dwPrefWinCodePage
- [in] Preferred Windows® code page. If this value is set to zero, this API returns all possible encodings. Otherwise, it lists only those encodings related to this parameter.
- pstmIn
- [in] Address of the IStream interface for the source stream.
- lpEncoding
- [in, out] Address of an array of DetectEncodingInfo structures where the detection information will be returned.
- pnScores
- [in, out] Address of a buffer that contains the number of DetectEncodingInfo structures allocated in lpEncoding. When this method is successful, this parameter returns the number of elements of lpEncoding that have been filled in.
Return Value
Returns one of the following values:
S_OK Success. S_FALSE The method cannot determine the code page of the input stream. E_FAIL An error occurred.
Remarks
The caller is responsible for allocating and freeing the lpEncoding array.
See Also