Skip to content

CSV export: BOM, missing columns and formula escaping - #484

Merged
lostindark merged 4 commits into
lostindark:masterfrom
indep-arg:pr/csv-export
Oct 27, 2026
Merged

lostindark merged 4 commits into
lostindark:masterfrom
indep-arg:pr/csv-export

Conversation

@indep-arg

@indep-arg indep-arg commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Small changes to the CSV export:

  1. Write a UTF-8 BOM. Without it Excel opens the file as ANSI, and provider or device names with non-ASCII characters (Cyrillic, CJK, accents) come out garbled.
  2. Export Boot Critical and Extension Id. They can be shown in the list but weren't in the CSV. They're added at the end so the existing columns keep their positions.
  3. Prefix values starting with =, +, - or @ with an apostrophe so Excel doesn't evaluate them as formulas. Provider and device names come from third-party INF files. Plain numbers, like the -1 used for an unknown size, are left alone.

Driver Files is deliberately not exported. On my machine the NVIDIA display driver package alone lists about 13,000 files, which is far more than an Excel cell can hold (32,767 characters).

Tests added for the new columns and the escaping.

Excel opens a CSV without a BOM using the ANSI code page, so provider and
device names with non-ASCII characters (Cyrillic, CJK, accents) show up
garbled. Starting the file with a UTF-8 BOM makes Excel detect the
encoding; other CSV readers ignore it.
These columns can be shown in the list but were missing from the CSV.
They are added at the end so existing column positions don't change.
Excel and other spreadsheet apps evaluate a cell that starts with =, +, -
or @ as a formula. Provider and device names come from third-party INF
files, so prefix such values with an apostrophe. Plain numbers like the
-1 used for an unknown size are left alone.
On a machine with an NVIDIA GPU, the display driver package (nv_dispi.inf)
lists over 13,000 files, so its Driver Files cell was about 224,000
characters. That made the CSV roughly 28 times bigger, and Excel cuts a
cell at 32,767 characters. Keep the Boot Critical and Extension Id
columns; the file list is still shown in the app.
@indep-arg

Copy link
Copy Markdown
Contributor Author

Tested the new build in LibreOffice Calc. The import dialog now picks up the character set as UTF-8 on its own. With the current release it defaulted to Western Europe (Windows-1252), so anything with accents would have come in garbled.

The export also has the two new columns (Boot Critical and Extension Id).

@lostindark
lostindark merged commit 2f3b607 into lostindark:master Oct 27, 2026
2 checks passed
@indep-arg
indep-arg deleted the pr/csv-export branch October 28, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants