mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-02 10:58:00 -06:00
Strip leading byte-order mark in graph CSV parser
Found while testing crates/engine/src/cmd/graph/data.rs:45-47 (parse_csv) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 5.5
parent
6dac80e75d
commit
511bb23999
@@ -43,6 +43,7 @@ fn cell(c: &str) -> Cell {
|
||||
}
|
||||
|
||||
pub(super) fn parse_csv(csv: &str) -> (Vec<String>, Vec<String>, Vec<Vec<Option<f64>>>) {
|
||||
let csv = csv.strip_prefix('\u{feff}').unwrap_or(csv);
|
||||
// Records end at line breaks outside quotes; a record is tab-separated if it has a tab outside quotes.
|
||||
let rows: Vec<Vec<Cell>> = split_unquoted(csv, '\n')
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user