how do i convert unicode string to ansi format?
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
i have string that may contain unicode character,i want to write that strings into text file,replacing unicode character with unicode values
-
i have string that may contain unicode character,i want to write that strings into text file,replacing unicode character with unicode values
Hi, I suppose you want something like this (C++):
#include <sstream>
#include <iterator>
size_t OutputByteVals(const std::wstring ws, std::ostream& out)
{
const size_t nBytes = ws.size() * sizeof(wchar_t);
std::copy_n(reinterpret_cast<const char *>(ws.data()), nBytes , std::ostream_iterator<int>(out, " "));
return nBytes;
}cheers, AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Wednesday, March 2, 2011 3:22 AM