[gnumeric] csv: don't trim spaces as per rfc 4180
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] csv: don't trim spaces as per rfc 4180
- Date: Mon, 5 Oct 2020 01:08:09 +0000 (UTC)
commit a040e8a1f9fe0aafdc03fe7935019b8a49f0ca90
Author: Morten Welinder <terra gnome org>
Date: Sun Oct 4 21:06:27 2020 -0400
csv: don't trim spaces as per rfc 4180
RFC 4180 suggests that outer spaces in fields should be significant.
(It also warns of the considerable differences in csv interpretation.)
ChangeLog | 3 +++
NEWS | 1 +
src/stf-parse.c | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3d181b452..cf4c476a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2020-10-04 Morten Welinder <terra gnome org>
+ * src/stf-parse.c (stf_parse_options_guess_csv): Don't trim
+ spaces, see https://tools.ietf.org/html/rfc4180#section-2
+
* src/workbook-view.c (workbook_view_save_as): If we don't get a
modtime from the url, don't try to do anything with in. Notably
happens with fd://1
diff --git a/NEWS b/NEWS
index d40ba6f74..e6b5875d0 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Morten:
* Fix autofill array critical. [#511]
* Handle missing values in xlsx. [#517]
* Fix critical when using fd://1.
+ * Don't trim spaces for csv files as per rfc 4180. [#528]
--------------------------------------------------------------------------
Gnumeric 1.12.48
diff --git a/src/stf-parse.c b/src/stf-parse.c
index 215a14271..5057bbecf 100644
--- a/src/stf-parse.c
+++ b/src/stf-parse.c
@@ -1726,7 +1726,7 @@ stf_parse_options_guess_csv (char const *data)
res = stf_parse_options_new ();
stf_parse_options_set_type (res, PARSE_TYPE_CSV);
- stf_parse_options_set_trim_spaces (res, TRIM_TYPE_LEFT | TRIM_TYPE_RIGHT);
+ stf_parse_options_set_trim_spaces (res, TRIM_TYPE_NEVER);
stf_parse_options_csv_set_indicator_2x_is_single (res, TRUE);
stf_parse_options_csv_set_duplicates (res, FALSE);
stf_parse_options_csv_set_trim_seps (res, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]