How would one go about reading a Japanese EUC encoded file in Visual C++? In
MSDN, I looked up EUC and it said it was 51932, in the 932 family with JIS
and SJIS. I tried opening my file like this:
std::wifstream src;
src.imbue(std::locale("ja_JP.euc-jp"));
src.open(L"post.euc");
but it gave me a runtime error. So I inserted the code family instead, like
below:
std::wifstream src;
src.imbue(std::locale(".932"));
src.open(L"post.euc");
The program now runs, but the Japanese text is garbled. if I look at the
file in Internet Explorer, the browser defaults on SJIS and I get the same
garbled text. But if I manually change the display encoding to EUC, the
files displays correclty.
Is it not possible to use C++ do this? Will I need Win32 API file I/O
functions instead?