commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CSV-135) Char escape doesn't work
Date Tue, 19 Jan 2016 18:53:39 GMT

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

Gary Gregory commented on CSV-135:
----------------------------------

Hi Sebb,

{quote}
The fundamental problem here is that there is no single definition of what constitutes the
CSV format.
{quote}
Hence the CSVFormat class and its many settings ;-) It sounds like we needs a CSVFormat.SYBASE
constant then? What would that look like and what additional setting do we need to toggle
escaping behavior if any?

> 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
>             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
(v6.3.4#6332)

Mime
View raw message