Subject: | Bug/Feature |
Date: | Tue, 17 Oct 2006 08:03:34 +0100 |
To: | bug-Text-CSV_PP [...] rt.cpan.org |
From: | Chaitanya Kuber <chaitanya [...] multimap.com> |
Hi
I have a bug /feature request to report for the combine method in
CSV_PP module.
If a user creates a instance of CSV_PP with quote_chars set, then the
combine method will quote a column value if it is required based on
certain heuristics.
This is fine for most cases. Where it does fall apart is when the
column value is of a different character set or encoding to that of
the quote character.
For example: If the values that you are combining happen to come out
of a Excel file and are encoded in ucs2 encoding, which is what Excel
uses for Unicode characters, then appending the quotation to the
column value will cause a character mismatch and the column value
gets garbled.
One solution (and the one I am using) provide combine with 2 arrays
- one with the column values
- one with the column character encodings
Then encode the quote character in the same encoding as the value of
the column and then append the quotes to the column value.
If there are any other ideas on how to solve problem, please do let
me know.
Hope this helps.
Cheers
----------------------------
Chaitanya Kuber
Software Engineer
multimap
e: chaitanya@multimap.com
t: +44 (0)20 7632 7821 (direct line)
t: +44 (0)20 7632 7700 (switchboard)
f: +44 (0)20 7681 2094
165 Fleet Street, London EC4A 2DY
http://www.multimap.com/map/browse.cgi?pc=EC4A2D
Winner of the Queen's Award for Enterprise: Innovation category, 2006
One of Britain's fastest-growing companies: Sunday Times Virgin
Atlantic Fast Track 100 league table, 2006
One of Britain's fastest-growing technology companies for the fourth
year running: Sunday Times Microsoft Tech Track 100 league table, 2006