[BUG] lookup_lsid.csv escaping issue

5 views
Skip to first unread message

Mike Giddens

unread,
Jan 3, 2009, 11:54:32 PM1/3/09
to Biodiversity Collections Index
I was playing with the csv file today and found that with this simple
test:

$handle = fopen("lookup_lsid.csv", "r");
while (($data = fgetcsv($handle, 5000, ",")) !== FALSE) {
print_r($data);
}

You will get corrupt data for certain reconrds that have a name
containing \"
It looks like there is some escaping going on but it is causing the
fgetcsv to escape the " and pushes things around.

A quick fix I used was to do a string replace \" => \ " on the file in
wordpad for now so that I could load the data. This should be an easy
fix and thought you could resolve this issue so that others don't face
the same issue.

I will be making another post in a day or so to show off something
cool ;)

Cheers,

Mike

rogerhyam

unread,
Jan 8, 2009, 8:53:49 AM1/8/09
to Biodiversity Collections Index
Thanks for this Mike. I'll add it to the bug list.

I wonder who decreed that every developer should spend 20% of there
time doing escaping/encoding issues and 70% on cross browser CSS
problems - it certainly seems like that anyhow...

Roger
Reply all
Reply to author
Forward
0 new messages