hawk9821 commented on code in PR #10383:
URL: https://github.com/apache/seatunnel/pull/10383#discussion_r2719190960


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/CsvReadStrategy.java:
##########
@@ -145,15 +146,23 @@ public void readProcess(
                     }
                 }
             }
-            // read lines
+            // read header lines
             List<String> headers = getHeaders(csvParser);
+            // Clean up BOM characters (\ uFEFF) in the header to solve 
occasional BOM residue
+            // issues
+            List<String> cleanedHeaders =
+                    headers.stream()
+                            .map(header -> header.replace("\uFEFF", "").trim())

Review Comment:
   **\uFEFF** is the UTF-8 BOM (Byte Order Mark), a special non-printable 
character that usually appears at the start of files saved in the UTF-8 with 
BOM encoding. (Tools such as Notepad and Excel on the Windows system often add 
this mark automatically when saving files in UTF-8 format.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to