informix数据库中,当把一个文本文件以BLOG的方式存入后,再通过unload导出时得到的是ASC码形式的文本文件。
要转成原始的文本文件通过如下方式:
FILE *fin = NULL, *fout = NULL;
char *stopstring;
char szBuf[4] = "/0";
CString str;
fin = fopen("d://111.txt", "rb");
fout = fopen("d://222.txt", "w+t");
fseek(fin, 0, SEEK_SET);
while ( fgets( szBuf, 3, fin ) )
{
int iCget = strtol( szBuf, &stopstring, 16 );
str = str + (char)(iCget);
}
fwrite(str, sizeof(byte), str.GetLength(), fout);
fclose(fin);
fclose(fout);