Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A0B318D81 for ; Tue, 21 Jul 2015 20:15:05 +0000 (UTC) Received: (qmail 17284 invoked by uid 500); 21 Jul 2015 20:15:05 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 17188 invoked by uid 500); 21 Jul 2015 20:15:05 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 17170 invoked by uid 99); 21 Jul 2015 20:15:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2015 20:15:04 +0000 Date: Tue, 21 Jul 2015 20:15:04 +0000 (UTC) From: "tim hood (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14635731#comment-14635731 ] tim hood edited comment on CSV-63 at 7/21/15 8:14 PM: ------------------------------------------------------ This seems to work or have I got the wrong idea. {code:java} @SuppressWarnings("static-method") @Test public void test() { try { final CSVFormat format = CSVFormat.DEFAULT.withEscape('\\').withQuoteMode(QuoteMode.NONE); final StringWriter out = new StringWriter(); try (CSVPrinter printer = new CSVPrinter(out, format)) { printer.printRecord(Arrays.asList(new String[] { "", "", "" })); } final String result = out.toString().trim(); System.out.println(">>" + result + "<<"); Assert.assertEquals(2, result.length()); } catch (final IOException e) { Assert.fail(e.getMessage()); } } {code} was (Author: timz): This seems to work or have I got the wrong idea. ```java @SuppressWarnings("static-method") @Test public void test() { try { final CSVFormat format = CSVFormat.DEFAULT.withEscape('\\').withQuoteMode(QuoteMode.NONE); final StringWriter out = new StringWriter(); try (CSVPrinter printer = new CSVPrinter(out, format)) { printer.printRecord(Arrays.asList(new String[] { "", "", "" })); } final String result = out.toString().trim(); System.out.println(">>" + result + "<<"); Assert.assertEquals(2, result.length()); } catch (final IOException e) { Assert.fail(e.getMessage()); } } ``` > CSVPrinter always quotes empty string if it is the first on a line > ------------------------------------------------------------------ > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer > Reporter: Sebb > Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)