stdioFile::CheckUniCodeBOM

Description

check UniCode file if has BOM

Syntax

int CheckUniCodeBOM( )

Parameters

Return

if bom exists, will return file's UniCodeType: UINICODE8, UINICODE16, etc.

otherwise, will return UNICODE_NON.

Examples

EX1

//the following example will type out any UniCode file if it has BOM
void stdioFile_CheckUniCodeBOM_ex1()
{
    string strFilename = "C:\\test.txt";
    stdioFile ff;
    bool bRet = ff.Open(strFilename, file::modeRead);
    if(!bRet)
    {
        out_str("file not found!");
        return;
    }
 
    if(ff.CheckUniCodeBOM() == 0) // no BOM exists
        out_str("no BOM exists");
    else
        out_str("BOM exists");
 
    ff.Close();
}

Remark

See Also

header to Include

origin.h