I am currently having problem with Unicode String in CSV files. I am Creating a CSV file using the below code from a dataset:

I am currently having problem with Unicode String in CSV files. I am Creating a CSV file using the below code from a dataset:

First writting the Column names using a loop:

ms.Write(Data[1], Length(Data)*SizeOf(Data[1]));
then
ms.Write(#13#10,2*SizeOf(char));

then writiing the data row:

ms.Write(Data[1], Length(Data)*SizeOf(Data[1]));
ms.Write(#13#10,2*SizeOf(char));

It is creating the CSV correctly but when try to importing the CSV it is showing junk character between each of the character.
Could you please let us know how to write unicode string in CSV.

Comments

  1. Mike Shkolnik Depends entirely on the parser. Plenty of CSV parsers will not recognise BOMs at all.

    ReplyDelete
  2. Yes, of course. Our SMImport suite recognize the BOMs in files:-)

    ReplyDelete
  3. Mike Shkolnik Fine. Many CSV parsers do not. Which parser is the asker using?

    ReplyDelete

Post a Comment