Repository navigation
CSV export: BOM, missing columns and formula escaping - #484
Merged
Merged
Conversation
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.
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small changes to the CSV export:
=,+,-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.