<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Multibyte-safe CSV Parser</title>
	<atom:link href="http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/feed/" rel="self" type="application/rss+xml" />
	<link>http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/</link>
	<description></description>
	<pubDate>Wed, 03 Dec 2008 23:48:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Kiril</title>
		<link>http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-893</link>
		<dc:creator>Kiril</dc:creator>
		<pubDate>Sat, 27 Sep 2008 00:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-893</guid>
		<description>A very good post.</description>
		<content:encoded><![CDATA[<p>A very good post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-152</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 23 Jun 2008 10:12:14 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-152</guid>
		<description>This line isn't correctly handled:
"lorem""lorem","""lorem""lorem""","lorem,lorem","""lorem,lorem""","""lorem"",""lorem"""

Output:

array(5) {
  [0]=&#62;
  'lorem"lorem'
  [1]=&#62;
  '""lorem"lorem","lorem'
  [2]=&#62;
  'lorem,""lorem'
  [3]=&#62;
  'lorem",""lorem"'
  [4]=&#62;
  '"lorem""'
}


It should be:

array(5) {
  [0]=&#62;
  'lorem"lorem'
  [1]=&#62;
  '"lorem"lorem"'
  [2]=&#62;
  'lorem,lorem'
  [3]=&#62;
  '"lorem,lorem"'
  [4]=&#62;
  '"lorem","lorem"'
}</description>
		<content:encoded><![CDATA[<p>This line isn&#8217;t correctly handled:<br />
&#8220;lorem&#8221;&#8220;lorem&#8221;,&#8221;&#8220;&#8221;lorem&#8221;&#8220;lorem&#8221;&#8220;&#8221;,&#8221;lorem,lorem&#8221;,&#8221;&#8220;&#8221;lorem,lorem&#8221;&#8220;&#8221;,&#8221;&#8220;&#8221;lorem&#8221;&#8221;,&#8221;&#8220;lorem&#8221;&#8220;&#8221;</p>
<p>Output:</p>
<p>array(5) {<br />
  [0]=><br />
  &#8216;lorem&#8221;lorem&#8217;<br />
  [1]=><br />
  &#8217;&#8221;&#8220;lorem&#8221;lorem&#8221;,&#8221;lorem&#8217;<br />
  [2]=><br />
  &#8216;lorem,&#8221;&#8220;lorem&#8217;<br />
  [3]=><br />
  &#8216;lorem&#8221;,&#8221;&#8220;lorem&#8221;&#8217;<br />
  [4]=><br />
  &#8217;&#8221;lorem&#8221;&#8221;&#8217;<br />
}</p>
<p>It should be:</p>
<p>array(5) {<br />
  [0]=><br />
  &#8216;lorem&#8221;lorem&#8217;<br />
  [1]=><br />
  &#8217;&#8221;lorem&#8221;lorem&#8221;&#8217;<br />
  [2]=><br />
  &#8216;lorem,lorem&#8217;<br />
  [3]=><br />
  &#8217;&#8221;lorem,lorem&#8221;&#8217;<br />
  [4]=><br />
  &#8217;&#8221;lorem&#8221;,&#8221;lorem&#8221;&#8217;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-17</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Thu, 20 Sep 2007 07:10:28 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-17</guid>
		<description>Cheers Matthew - thanks for the feedback, I missed that... i'll see if i can figure something out</description>
		<content:encoded><![CDATA[<p>Cheers Matthew &#8211; thanks for the feedback, I missed that&#8230; i&#8217;ll see if i can figure something out</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew</title>
		<link>http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-16</link>
		<dc:creator>Matthew</dc:creator>
		<pubDate>Mon, 17 Sep 2007 22:22:52 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-16</guid>
		<description>Awesome code. Great replacement for fgetcsv which *is* useless.

However, I have found one issue. It doesnt correctly handle "", representing an empty element when the escaper and enclosers are both "

It turns "", into """",

Right now I have am doing 
$line = str_replace('"",', ',', $line);
but obviously this is not a correct fix and will break if there really is escaped doulbe quotes within the element.</description>
		<content:encoded><![CDATA[<p>Awesome code. Great replacement for fgetcsv which <strong>is</strong> useless.</p>
<p>However, I have found one issue. It doesnt correctly handle &#8220;&#8221;, representing an empty element when the escaper and enclosers are both &#8221;</p>
<p>It turns &#8220;&#8221;, into &#8220;&#8221;&#8220;&#8221;,</p>
<p>Right now I have am doing <br />
$line = str_replace(&#8217;&#8221;&#8221;,&#8217;, &#8217;,&#8217;, $line);<br />
but obviously this is not a correct fix and will break if there really is escaped doulbe quotes within the element.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
