Why is my Bash script adding to the beginning of files?

前端 未结 2 414
孤独总比滥情好
孤独总比滥情好 2021-02-04 03:18

I\'ve written a script that cleans up .csv files, removing some bad commas and bad quotes (bad, means they break an in house program we use to transform these files) using sed:

2条回答
  •  旧巷少年郎
    2021-02-04 03:50

    U+FEFF is the code point for a byte order mark. Your files most likely contain data saved in UTF-16 and the BOM has been corrupted by your 'cleaning process' which is most likely expecting ASCII. It's probably not a good idea to remove the BOM, but instead to fix your scripts to not corrupt it in the first place.

提交回复
热议问题