Unicode 和 ANSI读写文件
2008-01-12 16:07
204 查看
// std::string strAnsi;
//#ifndef UNICODE
// strAnsi = strContent;
//#else
// USES_CONVERSION;
// strAnsi = W2A(strContent.LockBuffer());
// strContent.UnlockBuffer();
//#endif
const BYTE head[2] = {0xff,0xfe};
txtFile.Open(szFileName,CFile::modeWrite|CFile::modeCreate);
txtFile.Write(head,2 * sizeof(BYTE));
txtFile.Write(strContent,strContent.GetLength() *2);
txtFile.Close();
//#ifndef UNICODE
// strAnsi = strContent;
//#else
// USES_CONVERSION;
// strAnsi = W2A(strContent.LockBuffer());
// strContent.UnlockBuffer();
//#endif
const BYTE head[2] = {0xff,0xfe};
txtFile.Open(szFileName,CFile::modeWrite|CFile::modeCreate);
txtFile.Write(head,2 * sizeof(BYTE));
txtFile.Write(strContent,strContent.GetLength() *2);
txtFile.Close();
相关文章推荐
- VC 编程ANSI环境下读写Unicode文件和将CStdioFile类扩展,读取UNICODE文本文件
- VC 编程ANSI环境下读写Unicode文件和将CStdioFile类扩展,读取UNICODE文本文件
- VC 编程ANSI环境下读写Unicode文件
- VC 编程ANSI环境下读写Unicode文件和将CStdioFile类扩展,读取UNICODE文本文件
- VC 编程ANSI环境下读写Unicode文件和将CStdioFile类扩展,读取UNICODE文本文件
- VC 编程ANSI环境下读写Unicode文件
- VC 编程ANSI环境下读写Unicode文件
- VC 编程ANSI环境下读写Unicode文件和将CStdioFile类扩展,读取UNICODE文本文件
- VC 编程ANSI环境下读写Unicode文件(转载)
- [C/C++]_[Unicode转Utf8,Ansi转Unicode,Ansi文件转Utf8文件]
- UNICODE环境下读写txt文件操作
- Delphi读写UTF-8、Unicode格式文本文件
- VBA 向文件写入简单数据(默认编码为ANSI或者Unicode)
- PowerShell 读写Unicode文件
- Python读写unicode文件的方法
- python读写unicode文件之utf-16
- c#读写ANSI格式文件,解决中乱码问题最简单的写法
- 对java unicode编码以及读写文件编码的理解
- c#读写ANSI格式文件,解决中乱码问题最简单的写法
- C++使用Unicode字符集时配置文件读写