CStdioFile WriteString (Unicode Strings) failing?
-
Using CStdioile::WriteString, the Unicode string (having Chinese characters) is not writing into a file.. any suggestions?
kiranin wrote:
any suggestions?
What is it doing?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
kiranin wrote:
any suggestions?
What is it doing?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Using CStdioile::WriteString, the Unicode string (having Chinese characters) is not writing into a file.. any suggestions?
This is what I used in a project few days ago: std::basic_string<TCHAR> sFileContent = _T(""); if (sizeof(TCHAR) > 1) // if wide char sFileContent += 0xFEFF; // this header tells notepad to read file as Unicode sFileContent += _T("My favorite Dave Attell quote: "); sFileContent += _T("Yeah, I know, some people are against drunk driving, "); sFileContent += _T("and I call those people 'the cops'. But you know, "); sFileContent += _T("sometimes, you've just got no choice; those kids gotta get to school!"); // save to file routine
-
This is what I used in a project few days ago: std::basic_string<TCHAR> sFileContent = _T(""); if (sizeof(TCHAR) > 1) // if wide char sFileContent += 0xFEFF; // this header tells notepad to read file as Unicode sFileContent += _T("My favorite Dave Attell quote: "); sFileContent += _T("Yeah, I know, some people are against drunk driving, "); sFileContent += _T("and I call those people 'the cops'. But you know, "); sFileContent += _T("sometimes, you've just got no choice; those kids gotta get to school!"); // save to file routine
-
iT IS NOT WRITING ANYTHING ....I HAVE STRING WHICH IS HAVING ENGLISH + CHINESE - WRITING ENGLISH STRING ONLY WHEN CHINESE STARTS ITS WRITES NOTHING
THERE IS NO NEED TO SHOUT AT HIM. You said "failing". But imagine you go to the doctor, and say "I am ill", and then say nothing else. Do you expect him to give you a cure for cancer? Or when he says "Oh dear, that must be bad. What are your symptoms", you reply "I AM ILL"? IN WHAT WAY is it failing? Have you tried stepping into the CStdioFile::WriteFile yourself, and tracking your string to see where it goes wrong? Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
-
Using CStdioile::WriteString, the Unicode string (having Chinese characters) is not writing into a file.. any suggestions?
having the same problem here, someone to help ?