Skip to content

Commit 5063b16

Browse files
committed
CSV-77 RFC 4180 (DEFAULT) format is wrong; should not ignore spaces or blank lines
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1305482 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4406fba commit 5063b16

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,38 @@ public class CSVFormat implements Serializable {
5757
private static CSVFormat PRISTINE =
5858
new CSVFormat(DISABLED, DISABLED, DISABLED, DISABLED, false, false, false, null, null);
5959

60-
/** Standard comma separated format as defined by <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>. */
60+
/**
61+
* Standard comma separated format, as for {@link #RFC4180} but allowing blank lines.
62+
* <ul>
63+
* <li>withDelimiter(',')</li>
64+
* <li>withEncapsulator('"')</li>
65+
* <li>withEmptyLinesIgnored(true)</li>
66+
* <li>withLineSeparator(CRLF)</li>
67+
* </ul>
68+
*/
6169
public static final CSVFormat DEFAULT =
6270
PRISTINE.
6371
withDelimiter(',')
6472
.withEncapsulator('"')
65-
.withLeadingSpacesIgnored(true)
66-
.withTrailingSpacesIgnored(true)
6773
.withEmptyLinesIgnored(true)
6874
.withLineSeparator(CRLF)
6975
;
7076

77+
/**
78+
* Comma separated format as defined by <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>.
79+
* <ul>
80+
* <li>withDelimiter(',')</li>
81+
* <li>withEncapsulator('"')</li>
82+
* <li>withLineSeparator(CRLF)</li>
83+
* <li></li>
84+
* </ul>
85+
*/
86+
public static final CSVFormat RFC4180 =
87+
PRISTINE.
88+
withDelimiter(',')
89+
.withEncapsulator('"')
90+
.withLineSeparator(CRLF)
91+
;
7192

7293
/**
7394
* Excel file format (using a comma as the value delimiter).

0 commit comments

Comments
 (0)