G
Guest
I have a text file with wide characters. I use the following C++ code to read
them in. However the wide characters are not read in properly. What is wrong?
String* path = "C:\\Documents and Settings\\kst\\BE.dat";
try
{
FileStream* fs = new FileStream(path, FileMode::Open);
StreamReader* sr = new StreamReader(fs);
int count = 0;
while (sr->Peek() >= 0)
{
count++;
Debug::Write(__box(count));
Debug::WriteLine(__box((Char)sr->Read()), " ");
}
}
them in. However the wide characters are not read in properly. What is wrong?
String* path = "C:\\Documents and Settings\\kst\\BE.dat";
try
{
FileStream* fs = new FileStream(path, FileMode::Open);
StreamReader* sr = new StreamReader(fs);
int count = 0;
while (sr->Peek() >= 0)
{
count++;
Debug::Write(__box(count));
Debug::WriteLine(__box((Char)sr->Read()), " ");
}
}