How can I get Visual Studio 2010 to show Chinese comments properly

Posted by Joe H on Stack Overflow See other posts from Stack Overflow or by Joe H
Published on 2010-05-05T20:48:20Z Indexed on 2010/05/05 22:48 UTC
Read the original article Hit count: 229

Filed under:
|
|

I have some code from a Chinese business partner, but all of the comments in the code which are in Chinese. However, Visual Studio displays them as gibberish. How can I get them to display properly. Here is a code example with some comments converted to gibberish:

//Á¬½Óµ½·þÎñÆ÷
void CTestAPIDlg::OnBnClickedButton2()
{
    UpdateData(TRUE);
    //ÉèÖÃÊÇ·ñ¼Ç¼ÈÕÖ¾
    m_ObjRSI->EnableLog(m_bIsOnLogReg,m_bIsOnLogComm);
    //ÅжÏÊÇ·ñÆôÓôúÀí
    if (m_bIsOnProxy)
    {
        //´úÀí²ÎÊý
        char proxyIP[64];
        char proxyUserName[64];
        char proxyUserPwd[64];
        ZeroMemory(proxyIP,sizeof(proxyIP));
        ZeroMemory(proxyUserName,sizeof(proxyUserName));
        ZeroMemory(proxyUserPwd,sizeof(proxyUserPwd));
        //×¢£º´Ë´¦ÒòΪÊÇʹÓÃunicode±àÒ룬ËùÒÔÒª×Ö·ûת»»£¬ÏÂͬ.
        WideCharToMultiByte(CP_ACP,0,m_strProxyIP,-1,proxyIP,64,NULL,NULL);
        WideCharToMultiByte(CP_ACP,0,m_strProxyUserName,-1,proxyUserName,64,NULL,NULL);
        WideCharToMultiByte(CP_ACP,0,m_strProxyPwd,-1,proxyUserPwd,64,NULL,NULL);
        //ÉèÖôúÀí²ÎÊý
        m_ObjRSI->SetProxyParam(proxyIP,m_iProxyPort,proxyUserName,proxyUserPwd,m_iProxyType);
    }
    //Á¬½Ó²ÎÊý
    char szIp[64];
    ZeroMemory(szIp,sizeof(szIp));
    WideCharToMultiByte(CP_ACP,0,m_strIP,-1,szIp,64,NULL,NULL);
    //Á¬½Ó·þÎñÆ÷
    m_ObjRSI->SetCommParam(szIp,m_iPort,m_iCheckIDPort);
    m_ObjRSI->StartService();
    //ÉèÖð´Å¥×´Ì¬
    ((CButton*)GetDlgItem(IDC_CHECK2))->EnableWindow(FALSE);
    ((CButton*)GetDlgItem(IDC_CHECK3))->EnableWindow(FALSE);
}

Thanks in advance for any help...

© Stack Overflow or respective owner

Related posts about chinese

Related posts about visual-studio