[ 
https://issues.apache.org/jira/browse/CSV-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16865056#comment-16865056
 ] 

Sebb commented on CSV-135:
--------------------------

On the contrary, quote and escape chars can both be specified; indeed many 
formats do this.
For example ORACLE and INFORMIX_UNLOAD.

For parsing, this should not be a problem, as both <escape><anychar> and 
<quote><anychar> should generate <anychar>.
(Be liberal in what you accept)

However, for printing, if both are specified and the chars are different, which 
should take precedence?
(Be strict in what you generate)
This currently applies to the following formats:
INFORMIX_UNLOAD, ORACLE, POSTGRESQL_TEXT

> 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
>            Priority: Major
>             Fix For: Patch Needed
>
>
> 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
> {code}
> """","
> ","\"
> {code}
> instead of
> {code}
> "\"","\n","\\"
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to