[sf-perl] writing a csv file: ...

Rich Morin rdm at cfcl.com
Sun Apr 10 10:59:26 PDT 2011

At 2:15 PM +0100 4/10/11, Paul Makepeace wrote:
> A heartfelt plea from the trenches...
> Please, please do not write or use anything that produces
> CSV output!  There is no unicode standard around it and you
> WILL run into accented character and interop issues with it.
> Yes, English has accented characters(!) Also, as you've seen
> programs tend to be dumb about interpreting CSV.
> XLS gets UTF-8 right and is the best solution here.

I've been using CSV for a number of uses in my current project.
My original plan had been to use YAML, but my clients are more
comfortable with spreadsheets, so I gave that a try.

I've had to define some conventions to emulate data structures
(http://www.cfcl.com/rdm/weblog/archives/001729.html), but the
approach has been largely successful.

I haven't had any serious character-related problems, but I have
run into a few annoyances.  So, I thought it might be worthwhile
to follow up on this suggestion.

I looked up XLS in Wikipedia.  The "XML Spreadsheet" example on
this page immediately demonstrates one (expected) problem: the
example is about 10x the size of the equivalent CSV.

However, in some situations, this may be acceptable, so I copied
the text into a file (t1.xsl) and tried to open it with Numbers.
The result was amusing, but not particularly useful.

So, I think I'll stick with CSV for the duration...

http://www.cfcl.com/rdm            Rich Morin
http://www.cfcl.com/rdm/resume     rdm at cfcl.com
http://www.cfcl.com/rdm/weblog     +1 650-873-7841

Software system design, development, and documentation

More information about the SanFrancisco-pm mailing list