CheckUniCodeBOM
check UniCode file if has BOM
int CheckUniCodeBOM( )
if bom exists, will return file's UniCodeType: UINICODE8, UINICODE16, etc.
otherwise, will return UNICODE_NON.
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(); }
origin.h