Opened 10 years ago

Closed 10 years ago

#4844 closed enhancement (fixed)

CSV: Add option to write BOM for Excel Compatibility

Reported by: Robert Coup Owned by: Robert Coup
Priority: normal Milestone: 1.9.2
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: csv
Cc: Even Rouault

Description

As discussed in #4623, StackOverflow and elsewhere - if you want Excel to reliably open a CSV as UTF8 rather than doing something stupid, then it needs a UTF8 BOM marker.

Attached patch adds a CSV creation option (WRITE_BOM=YES) which adds a UTF8 BOM at the start of the file. With tests, docs, etc.

Dumb / good idea?

Attachments (1)

4844-csv-bom.1.patch (9.2 KB ) - added by Robert Coup 10 years ago.
patch against trunk at r25033

Download all attachments as: .zip

Change History (3)

by Robert Coup, 10 years ago

Attachment: 4844-csv-bom.1.patch added

patch against trunk at r25033

comment:1 by Even Rouault, 10 years ago

Looks good to me

comment:2 by Robert Coup, 10 years ago

Resolution: fixed
Status: newclosed

committed to trunk [25040] and 1.9 [25039].

Note: See TracTickets for help on using tickets.