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 A1A999668 for ; Mon, 12 Mar 2012 13:45:01 +0000 (UTC) Received: (qmail 69522 invoked by uid 500); 12 Mar 2012 13:45:01 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69441 invoked by uid 500); 12 Mar 2012 13:45:01 -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 69209 invoked by uid 99); 12 Mar 2012 13:45:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2012 13:45:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2012 13:45:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 089B61C954 for ; Mon, 12 Mar 2012 13:44:40 +0000 (UTC) Date: Mon, 12 Mar 2012 13:44:40 +0000 (UTC) From: "Emmanuel Bourg (Updated) (JIRA)" To: issues@commons.apache.org Message-ID: <1229563449.2514.1331559880054.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1183073676.2512.1331559879969.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (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 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CSV-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Emmanuel Bourg updated CSV-54: ------------------------------ Component/s: Parser > 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 > > {{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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira