Skip to content

Conversation

PatrikKozak
Copy link
Contributor

What?

Adds UTF-8 Byte Order Mark (BOM) to CSV exports in both streaming and buffered export paths.

Why?

CSV exports containing non-Latin scripts (e.g., Hebrew, Arabic, Chinese) display as mojibake in Microsoft Excel on Windows because Excel defaults to ANSI encoding and fails to auto-detect UTF-8 without a BOM.

The BOM (EF BB BF) signals UTF-8 encoding to Excel without breaking compatibility with other tools (Google Sheets, LibreOffice, modern CSV parsers all handle it correctly).

How?

  • Prepend UTF-8 BOM (0xEF 0xBB 0xBF) to the first chunk in streaming CSV exports
  • Prepend UTF-8 BOM character (\uFEFF) to buffered CSV exports
  • Updated Content-Type headers to explicitly include charset=utf-8 for CSV files
  • JSON exports remain unchanged (no BOM)

Fixes #13929

Copy link
Contributor

github-actions bot commented Oct 2, 2025

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSV Export Lacks UTF-8 BOM, Causing Display Issues in Microsoft Excel for Non-Latin Scripts (e.g., Hebrew)
1 participant