ColdFusion – csv file BOM Header problem CF2023
I’m running cf2023 on windows and I’m having a weird problem with basic functionality that was working normally on the cf2016 version I was using earlier.
Every attempt to generate a csv file in which the Croatian characters will be displayed correctly has so far been unsuccessful.
I tried changing the JVM arguments and adding -Dfile.encoding=UTF8 but it didn’t help.
BOM header problem – adding #CHR(65279)# to the beginning of the csv content helped.
<cfprocessingdirective pageencoding="utf-8">
<cfset content = '#CHR(65279)#priča;požarevac;PRIŠTINA;ČAKOVEC;ŽUPANJA;ĐAKOVO;rođak'>
<cffile action="write"
file="#expandPath('temp')#/test.csv"
output="#content#"
addnewline="yes" charset="utf-8">
source: https://community.adobe.com/t5/coldfusion-discussions/adding-utf-8-bom-byte-order-mark-to-file-output/m-p/11745053