Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,408 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,460 people online right now. Registration is fast and FREE... Join Now!




reading a utf8 encoded text file using Cdao

 
Reply to this topicStart new topic

reading a utf8 encoded text file using Cdao

bovilla
15 Oct, 2008 - 06:22 AM
Post #1

New D.I.C Head
*

Joined: 15 Oct, 2008
Posts: 1

Hi,

I have a requirement of reading a text file, which is utf8 encoded and contains some non ascii characters. My case i have chinese characters.

i am using CDaoRecordSet->GetFieldValue() to read the text file. This function reads the file and returns me a COleVariant. My problem is as the text file is UTF8 encoded and the DAO class returns me a Bstr, the data read is not proper. when i convert the data back to UTF8, the data is getting garbled.

Is there any better way i could read a UTF8 encoded text file, using DAO and still not loose any data.

OR is this a limitation with CDaoRecordSet class.

Any help on this would be appreciated.

Thanks
bovilla
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 12:12PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month