File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 */
5454public 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 ();
You can’t perform that action at this time.
0 commit comments