#include <afx.h>
/******************************************************************
函数名称:IsUnicodeFile
函数功能:判断某个文件是否是unicode文件
输入参数:
输出参数:int -1:表示该文件不存在,
0:表示不是unicode文件,
1:表示是unicode文件
作者: 盐城汤菜-管砥群
备注:491258707
******************************************************************/
int IsUnicodeFile(PTSTR pstrName)
{
try
{
CFile cf(pstrName, CFile::modeRead );
BYTE ch[100];
memset(ch, 0, 100);
int ii = cf.Read(ch, 100);
cf.Close();
int i = 0;
int iU = IS_TEXT_UNICODE_SIGNATURE | IS_TEXT_UNICODE_REVERSE_SIGNATURE;
if(IsTextUnicode(ch, 100, &iU))//是否是unicode文件
{
return 1;
}
return 0;
}
catch (CException* e)
{
return -1;
}
return 0;
}
判断某个文件是否是unicode编码的
最新推荐文章于 2024-05-08 12:52:38 发布