commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mateusz Zakarczemny (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CSV-135) Char escape doesn't work
Date Tue, 07 Oct 2014 13:05:33 GMT

     [ https://issues.apache.org/jira/browse/CSV-135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mateusz Zakarczemny updated CSV-135:
------------------------------------
    Description: 
Following code:
{code}
CSVFormat format = CSVFormat.DEFAULT
	.withRecordSeparator('\n')
	.withQuote('"')
	.withEscape('\\');

CSVPrinter printer = new CSVPrinter(System.out, format);
List<String> l = new LinkedList<String>();
l.add("\"");
l.add("\n");
l.add("\\");
printer.printRecord(l);
{code}
produces
{quote}
"""","
","\"
{quote}
instead of
{quote}
"\"","\n","\\\\"
{quote}

  was:
Following code:
{code}
CSVFormat format = CSVFormat.DEFAULT
	.withRecordSeparator('\n')
	.withQuote('"')
	.withEscape('\\');

CSVPrinter printer = new CSVPrinter(System.out, format);
List<String> l = new LinkedList<String>();
l.add("\"");
l.add("\n");
l.add("\\");
printer.printRecord(l);
{code}
produces
{quote}
"""","
","\"
{quote}
instead of
{quote}
"\"","\n","\\\"
{quote}


> Char escape doesn't work
> ------------------------
>
>                 Key: CSV-135
>                 URL: https://issues.apache.org/jira/browse/CSV-135
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Printer
>    Affects Versions: 1.0
>            Reporter: Mateusz Zakarczemny
>
> Following code:
> {code}
> CSVFormat format = CSVFormat.DEFAULT
> 	.withRecordSeparator('\n')
> 	.withQuote('"')
> 	.withEscape('\\');
> CSVPrinter printer = new CSVPrinter(System.out, format);
> List<String> l = new LinkedList<String>();
> l.add("\"");
> l.add("\n");
> l.add("\\");
> printer.printRecord(l);
> {code}
> produces
> {quote}
> """","
> ","\"
> {quote}
> instead of
> {quote}
> "\"","\n","\\\\"
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message