CSV import does not strip UTF-8 BOM, breaking first column header recognition
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
The Content Import tool does not strip the UTF-8 Byte Order Mark (BOM) from uploaded CSV files. When a BOM is present, the first column header is not recognized correctly, so the import silently mismaps or fails to match that column — with no error surfaced to the user.
This is a common round-trip: a customer exports content from dotCMS as CSV, opens/edits it in Excel, and re-saves as "CSV UTF-8 (Comma delimited)" — which Excel writes with a BOM (EF BB BF). Re-importing that file then breaks on the first column.
Impacts any customer using the CSV import/export round-trip via Excel. Silent failure — costs support time to diagnose because no error is shown.
Steps to Reproduce
- Export (or create) a CSV whose first row is the header row.
- Save the file as "CSV UTF-8 (Comma delimited)" in Excel (this prepends a UTF-8 BOM, bytes
EF BB BF). - Import the file via the Content Import tool.
- See that the first column header is not recognized — the BOM is treated as part of the first header token, so that column fails to map.
Acceptance Criteria
- The CSV import parser detects and strips a leading UTF-8 BOM before parsing the header row.
- The first column header is recognized correctly when the uploaded file contains a BOM.
- BOM handling is consistent (ideally UTF-8/UTF-16) so re-imported Excel "CSV UTF-8" files work without manual editing.
dotCMS Version
Evergreen
Severity
Medium - Some functionality impacted
Links
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Content Import tool's CSV import parser and trace how the header row is read. Add coverage for a leading UTF-8 BOM, then verify that the first column maps correctly and that the existing import behavior remains intact; consider the stated UTF-16 consistency requirement if the parser supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100