troubleshooting Question

how to read the unicode for text in a unicode txt file?

Avatar of UdiRaz
UdiRaz asked on
C++System Programming
9 Comments1 Solution1451 ViewsLast Modified:
Hi,
i am probably missing something here. I have a unicode txt file with the following text : " a b 1 Ð -  0 " and I would like to know what is the unicode of each characters. I tried two ways, What am I doing wrong ?

the result buffer show the unicode of the characters 'a', 'b', '1' and '-' correct but to the other characters.
My project is a unicode project.

Please advice

Thanks,

Udi Raz
1.
TCHAR buffer[150];
CFile file;
file.Open( _T("c:\\aaa.txt"), CFile::modeRead );
file.Read( buffer, 300 );
 
2.
TCHAR buffer[150];
std::wifstream f( _T("c:\\aaa.txt") );
f.getline(buffer,sizeof(buffer));
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros