diff --git a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java index bc7ac9b5..3ee2438f 100644 --- a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java +++ b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java @@ -53,6 +53,7 @@ import org.junit.Test; */ public class CSVPrinterTest { + private static final char EURO_CH = '\u20AC'; private static final char DQUOTE_CHAR = '"'; private static final char BACKSLASH_CH = '\\'; private static final char QUOTE_CH = '\''; @@ -806,6 +807,15 @@ public class CSVPrinterTest { } } + @Test + public void testRfc4180QuoteSingleChar() throws IOException { + final StringWriter sw = new StringWriter(); + try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.RFC4180)) { + printer.printRecord(EURO_CH, "Deux"); + assertEquals("\"" + EURO_CH + "\",Deux" + recordSeparator, sw.toString()); + } + } + @Test public void testPrinter2() throws IOException { final StringWriter sw = new StringWriter();