Unicode support
-
Hi friends I have a program which reads a file from web. That file contains unicode (UTF-8) chars. I used below code for my operation, but it shows junk chars while reading file, please suggest a solution to me.
CInternetSession InternetSession;
CStdioFile *httpFile;
CString str;httpFile = InternetSession.OpenURL("www.mysite.com");
while( httpFile->ReadString( str ) )
{
AfxMessageBox( str );
}thanks in advance
-kk.tvm-
-
Hi friends I have a program which reads a file from web. That file contains unicode (UTF-8) chars. I used below code for my operation, but it shows junk chars while reading file, please suggest a solution to me.
CInternetSession InternetSession;
CStdioFile *httpFile;
CString str;httpFile = InternetSession.OpenURL("www.mysite.com");
while( httpFile->ReadString( str ) )
{
AfxMessageBox( str );
}thanks in advance
-kk.tvm-
try
httpFile = InternetSession.OpenURL(L"www.mysite.com");
:~ Failure is Success If we learn from it!!:~
-
try
httpFile = InternetSession.OpenURL(L"www.mysite.com");
:~ Failure is Success If we learn from it!!:~
-
Hi friends I have a program which reads a file from web. That file contains unicode (UTF-8) chars. I used below code for my operation, but it shows junk chars while reading file, please suggest a solution to me.
CInternetSession InternetSession;
CStdioFile *httpFile;
CString str;httpFile = InternetSession.OpenURL("www.mysite.com");
while( httpFile->ReadString( str ) )
{
AfxMessageBox( str );
}thanks in advance
-kk.tvm-
-
Hi friends I have a program which reads a file from web. That file contains unicode (UTF-8) chars. I used below code for my operation, but it shows junk chars while reading file, please suggest a solution to me.
CInternetSession InternetSession;
CStdioFile *httpFile;
CString str;httpFile = InternetSession.OpenURL("www.mysite.com");
while( httpFile->ReadString( str ) )
{
AfxMessageBox( str );
}thanks in advance
-kk.tvm-
You need to convert the UTF-8 to whatever encoding you're using for CString. Have a look at this article[^]...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p CodeProject MVP for 2010 - who'd'a thunk it!