I use tree languages in my MFC application. The application compiled as UNICODE. I need generate html with some text from the controls, and I want create regular html file that contain html characters instead UNICODE, for example the russian letter 'A' will be written as =& # 1040 ; (without spaces)
Something like this (IDC_EDIT_TXT contains Unicode text):
I tried convert the string with this function:Code:CString str; CStdioFile fileU(_T("c:\\temp\\unicode.html"),CFile::modeCreate|CFile::modeWrite); GetDlgItemText(IDC_EDIT_TXT,str); fileU.WriteString(str);
but the result was binary unicode string.Code:char szString [1000]; int len = WideCharToMultiByte(CP_UTF8,0,str,-1,szString,sizeof(szString),NULL,NULL); fileU.Write(szString,len);
Do you know how to convert it do html characters?




Reply With Quote