Browse Source

* Added DetectBOM to TCSVDocument

Michaël Van Canneyt 3 years ago
parent
commit
cb03124cc5
1 changed files with 8 additions and 0 deletions
  1. 8 0
      packages/fcl-base/src/csvdocument.pp

+ 8 - 0
packages/fcl-base/src/csvdocument.pp

@@ -56,8 +56,12 @@ type
   {$ENDIF}
 
   // Random access to CSV document. Reads entire document into memory.
+
+  { TCSVDocument }
+
   TCSVDocument = class(TCSVHandler)
   private
+    FDetectBOM: Boolean;
     FRows: TFPObjectList;
     FParser: TCSVParser;
     FBuilder: TCSVBuilder;
@@ -130,6 +134,9 @@ type
     // Remove empty cells at end of rows from entire document
     procedure RemoveTrailingEmptyCells;
 
+    // Detect bom
+    Property DetectBOM : Boolean Read FDetectBOM Write FDetectBOM;
+
     // Properties
 
     // Cell data at column ACol, row ARow.
@@ -428,6 +435,7 @@ begin
   FreeAndNil(FParser);
   FParser:=TCSVParser.Create;
   FParser.AssignCSVProperties(Self);
+  FParser.DetectBOM:=Self.DetectBOM;
   with FParser do
   begin
     SetSource(AStream);