1. 调用 WideCharToMultiByte() API
int WideCharToMultiByte (
UINT CodePage, //1 Unicode编码的字符页,Unicode编码有字符页的概念,比如gb2312/936,big5/950等
DWORD dwFlags, //2 如何处理复合unicode字符,详细查google
LPCWSTR lpWideCharStr, //3 待转换的unicode串
int cchWideChar, //4 表示参数3的长度 传递-1表示以0x00结尾
LPSTR lpMultiByteStr, //5 接受转换后的串的字符缓冲
int cbMultiByte, //6 表示参数5lpMutiByteStr的字节大小 通常sizeof一下
LPCSTR lpDefaultChar, //7 NULL 具体google
LPBOOL lpUsedDefaultChar//8 NULL 具体google
);
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2. 调用CRT函数wcstombs()
size_t wcstombs (
char* mbstr,
const wchar_t* wcstr,
size_t count );
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3. 使用CString构造器或赋值操作
// 假设有一个Unicode串wszSomeString![](http://www.cnblogs.com/Images/dot.gif)
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
CString str1 ( wszSomeString ); // 用构造器转换
CString str2;
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
str2 = wszSomeString; // 用赋值操作转换
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4. 使用ATL串转换宏
#include <atlconv.h>
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
// 还是假设有一个Unicode串wszSomeString![](http://www.cnblogs.com/Images/dot.gif)
![](http://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
{
char szANSIString [MAX_PATH];
USES_CONVERSION; // 声明这个宏要使用的局部变量
![](http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
lstrcpy ( szANSIString, OLE2A(wszSomeString) );
}