Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Commit fa437cb

Browse files
committed
Add testRfc4180QuoteSingleChar().
1 parent 190390b commit fa437cb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/test/java/org/apache/commons/csv/CSVPrinterTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
*/
5454
public class CSVPrinterTest {
5555

56+
private static final char EURO_CH = '\u20AC';
5657
private static final char DQUOTE_CHAR = '"';
5758
private static final char BACKSLASH_CH = '\\';
5859
private static final char QUOTE_CH = '\'';
@@ -806,6 +807,15 @@ public void testPrinter1() throws IOException {
806807
}
807808
}
808809

810+
@Test
811+
public void testRfc4180QuoteSingleChar() throws IOException {
812+
final StringWriter sw = new StringWriter();
813+
try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.RFC4180)) {
814+
printer.printRecord(EURO_CH, "Deux");
815+
assertEquals("\"" + EURO_CH + "\",Deux" + recordSeparator, sw.toString());
816+
}
817+
}
818+
809819
@Test
810820
public void testPrinter2() throws IOException {
811821
final StringWriter sw = new StringWriter();

0 commit comments

Comments
 (0)