dotCMS / dotCMS/core

CSV import does not strip UTF-8 BOM, breaking first column header recognition

Open
#36,508 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support Type : Defect
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

  1. Export (or create) a CSV whose first row is the header row.
  2. Save the file as "CSV UTF-8 (Comma delimited)" in Excel (this prepends a UTF-8 BOM, bytes EF BB BF).
  3. Import the file via the Content Import tool.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.