All the follwing assumes that your application is a Unicode build.
It looks like you have derived your
CSVFile
class from
CStdioFile
. Then
ReadString()
will convert multi byte file content to wide char using the actually selected code page of the user running your application. That will lead to wrong results when the CSV file has been created with a different encoding.
The main problem is to know which encoding / code page has been used to create the CSV file. If you have control on that, I suggest to use UTF-8 if possible.
Once you know the code page, read the file content into a
char
buffer (e.g. using
fgets()
) and call the
MultiByteToWideChar function (Windows)[
^] to convert to Unicode.