Hi,
Thanks for the file.
The bad news is that this indeed a bug, and the bug is actually in Delphi's TStreamReader, so we can't really fix it. We are actually aware of the bug, that while really rare might happen, and so we use our own streamreader for reading xlsx files, but for csv we can't use an internal streamreader because some internal reasons, even when I'll review if it is possible. We were also waiting to see if the bug is fixed, but I tried it with XE5 and the bug is still there.
The good news is that in this case, you can still read the file, since we were reading it wrong anyway. The file is in a cyrillic character set, so if you try to open it with the default encoding (utf8) you'll get garbage anyway (and that's what I get if I open the file with my Excel version here. Probably a russian Excel will open this file fine, but not any other localized Excel).
Try with the following code, it should open the file and also get the right text, not garbage:
var
enc: TEncoding;
begin
xls := TXlsFile.Create;
try
enc := TEncoding.GetEncoding(1251);
try
xls.Open('e:\downloads\pay90_0.csv', TFileFormats.Text, ';', 1, 1, nil, nil, enc, false);
ShowMessage(xls.GetCellValue(2, 1).ToString);
finally
enc.Free;
end;
finally
xls.Free;
end;
As said, this will actually mask the bug not fix it: The bug in streamreader happens in very little corner cases, which your file happened to trigger, if trying to read it as UTF8. When trying to read it as cyrillic, it won't.
Another thing, I assumed code 1251:
http://en.wikipedia.org/wiki/Windows-1251 but I don't really know which encoding this file really is. While probably it is 1251, it might be KOI8R or something else. You need to know the codepage for the computer where this file was generated in order to do a correct import.