Hi,
I'm having major problems with Perl and wide characters, specifically the GBP (£) pound sign.
If I create my own CSV string and output it to the browser, when I open the CSV file, there is a funny char displayed with the pound sign (£).
So I am trying to create a Unicode CSV string using the Text::CSV::Unicode module, only it won't parse my CSV string.
The line it says it doesn't like is...
which is found using
I can only assume it doesn't like the carriage return in the last encapsulated column value, but it should as I have created the object using
And the CPAN docs say
So there should be no problem with either \r or \n in any of the fields in my input array?
Any ideas how I fix this pound sign problem or get the Text::CSV::Unicode to accept my input?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I'm having major problems with Perl and wide characters, specifically the GBP (£) pound sign.
If I create my own CSV string and output it to the browser, when I open the CSV file, there is a funny char displayed with the pound sign (£).
So I am trying to create a Unicode CSV string using the Text::CSV::Unicode module, only it won't parse my CSV string.
The line it says it doesn't like is...
"Axxxx xxxx xxxx Ltd","Alan Smith","Carl Jones","Legal & General","30/07/2009","524.89","22/07/2011","306.09","24/08/2011","Protection","Reinstatement £306.09
13/12/11 C/B £306.09"
which is found using
Code:
$csv->error_input
I can only assume it doesn't like the carriage return in the last encapsulated column value, but it should as I have created the object using
Code:
my $csv = Text::CSV::Unicode->new([{ binary => 1 }]);
And the CPAN docs say
new $csv = Text::CSV::Unicode->new( [{ binary => 1 }] );
This function may be called as a class or an object method. It returns a reference to a newly created Text::CSV::Unicode object. binary => 0 allows the same ASCII input as Text::CSV and all other input, while binary => 1 allows for all Unicode characters in the input (including \r and \n),
So there should be no problem with either \r or \n in any of the fields in my input array?
Any ideas how I fix this pound sign problem or get the Text::CSV::Unicode to accept my input?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads