Share via


IMultiLanguage2::DetectInputCodepage method

Detects the code page of the given string.

Syntax

HRESULT DetectInputCodepage(
  [in]      DWORD              dwFlag,
  [in]      DWORD              dwPrefWinCodePage,
  [in]      __wchar_t          *pSrcStr,
  [in, out] INT                *pcSrcSize,
  [in, out] DetectEncodingInfo *lpEncoding,
  [in, out] 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]
    The 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.

  • pSrcStr [in]
    The ource string for which the client wants to detect the code page.

  • pcSrcSize [in, out]
    The address of the buffer that stores the size of pSrcStr, in bytes. When this method is successful, it returns the number of bytes processed to this buffer.

  • lpEncoding [in, out]
    A pointer to an array of DetectEncodingInfo structures where the detection information is returned.

  • pnScores [in, out]
    A pointer to 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 are filled in.

Return value

Returns one of the following values.

Return code Description
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.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mlang.h

IDL

Mlang.idl

DLL

Mlang.dll

See also

IMultiLanguage2

IMultiLanguage2::DetectCodepageInIStream