@@ -557,9 +557,9 @@ public Quote getQuotePolicy() {
557557 }
558558
559559 /**
560- * Returns the line separator delimiting output records.
560+ * Returns the record separator delimiting output records.
561561 *
562- * @return the line separator
562+ * @return the record separator
563563 */
564564 public String getRecordSeparator () {
565565 return recordSeparator ;
@@ -738,13 +738,6 @@ private void validate() throws IllegalArgumentException {
738738 if (escape == null && quotePolicy == Quote .NONE ) {
739739 throw new IllegalArgumentException ("No quotes mode set but no escape character is set" );
740740 }
741-
742- if (recordSeparator != null &&
743- !(CRLF .equals (recordSeparator ) ||
744- String .valueOf (CR ).equals (recordSeparator ) ||
745- String .valueOf (LF ).equals (recordSeparator ))) {
746- throw new IllegalArgumentException ("Record separator can only by CR, LF or CRLF" );
747- }
748741 }
749742
750743 /**
@@ -965,14 +958,13 @@ public CSVFormat withQuotePolicy(final Quote quotePolicy) {
965958 /**
966959 * Sets the record separator of the format to the specified character.
967960 *
968- * <p><strong>Note:</strong> Currently only CR and LF are supported.</p>
961+ * <p><strong>Note:</strong> This setting is only used during printing and does not affect parsing. Parsing currently
962+ * only works for inputs with '\n', '\r' and "\r\n"</p>
969963 *
970964 * @param recordSeparator
971965 * the record separator to use for output.
972966 *
973967 * @return A new CSVFormat that is equal to this but with the the specified output record separator
974- * @throws IllegalArgumentException
975- * if recordSeparator is neither CR nor LF
976968 */
977969 public CSVFormat withRecordSeparator (final char recordSeparator ) {
978970 return withRecordSeparator (String .valueOf (recordSeparator ));
@@ -981,7 +973,8 @@ public CSVFormat withRecordSeparator(final char recordSeparator) {
981973 /**
982974 * Sets the record separator of the format to the specified String.
983975 *
984- * <p><strong>Note:</strong> Currently only CR, LF and CRLF are supported.</p>
976+ * <p><strong>Note:</strong> This setting is only used during printing and does not affect parsing. Parsing currently
977+ * only works for inputs with '\n', '\r' and "\r\n"</p>
985978 *
986979 * @param recordSeparator
987980 * the record separator to use for output.
0 commit comments