ZF-3141: Zend_Translate CSV adapter is not RFC 4180 compliant

Issue Type: New Feature Created: 2008-04-18T01:55:29.000+0000 Last Updated: 2008-09-02T10:38:54.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Joeri Sebrechts (jsebrech) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments: -


The CSV file format is specified in RFC 4180 "Common Format and MIME Type for CSV Files". ( )

This format specifies that to use the separator character in values, the values must be surrounded by double quotes (double quotes in the value must be included by doubling the double-quote character). However, the Zend_Translate CSV adapter is not compatible with such files.

As a result, CSV files edited with Excel are not compatible with the CSV adapter, severely decreasing its applicability.


Posted by Thomas Weidner (thomas) on 2008-04-18T02:03:51.000+0000

The CSV adapter was never intended to be RFCxxx compilant so this is not a bug but a feature enhancement.

Also RFC's are no standards, they are informational drafts which will lead to a standard. Until now such a standard has not been defined.

Posted by Thomas Weidner (thomas) on 2008-04-18T02:05:29.000+0000

Please give an example file where you see problems... Until now all CSV files worked, even from Excel 2003 which I worked with.

Posted by Joeri Sebrechts (jsebrech) on 2008-04-18T02:59:04.000+0000

I produced a file in Excel 2003. First column "FOO1", second column "Foo,;"1" (without the surrounding quotes).

This file when opened in notepad looks like this:

<pre class="highlight">

Outputting a translation from php with this code:

require_once("Zend/Translate.php"); $translate = new Zend_Translate("csv", "translation.csv", "en", array('separator' => ';')); echo $translate->_("FOO1");

<pre class="highlight">

On screen I get:

While I expect: ```

Attached you'll find the CSV file and PHP script.

Posted by Thomas Weidner (thomas) on 2008-06-02T14:07:46.000+0000

Integrated with r9585

Posted by Wil Sinclair (wil) on 2008-09-02T10:38:54.000+0000

Updating for the 1.6.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.