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 C635611E33 for ; Thu, 14 Aug 2014 20:08:34 +0000 (UTC) Received: (qmail 40183 invoked by uid 500); 14 Aug 2014 20:08:25 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 40098 invoked by uid 500); 14 Aug 2014 20:08:25 -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 40052 invoked by uid 99); 14 Aug 2014 20:08:25 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2014 20:08:25 +0000 Date: Thu, 14 Aug 2014 20:08:25 +0000 (UTC) From: "Benedikt Ritter (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CSV-54) Confusing semantic of the ignore leading/trailing spaces parameters 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-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benedikt Ritter closed CSV-54. ------------------------------ > Confusing semantic of the ignore leading/trailing spaces parameters > ------------------------------------------------------------------- > > Key: CSV-54 > URL: https://issues.apache.org/jira/browse/CSV-54 > Project: Commons CSV > Issue Type: Bug > Components: Parser > Reporter: Emmanuel Bourg > Fix For: 1.0 > > > {{CSVFormat}} has two parameters to control how the leading and trailing spaces around values are handled, but the actual behavior depends on the value being enclosed in quotes or not. > If the value is not enclosed in quotes, setting {{leading/trailingSpacesIgnored}} to {{true}} will left or right trim the value. For example with this input (using the default format): > {code}a, b ,c{code} > the second value will be equal to {{'b'}}. > But if the value is enclosed into quotes, the value is no longer trimmed: > {code}a," b ",c{code} > this will give {{' b '}}. > With quoted values the parser actually ignores the spaces between the delimiter and the quote. Thus with this input: > {code}a, " b " ,c{code} > The value returned is {{' b '}}. > If {{leading/trailingSpacesIgnored}} is set to {{false}}, we get instead {{' " b " '}} which is consistent with RFC 4180. -- This message was sent by Atlassian JIRA (v6.2#6252)