Re: ANNOUNCE: Text::CSV_XS 0.32



On 10/24/2007 11:59 PM, Petr Vileta wrote:
H.Merijn Brand wrote:
The following report has been written by the PAUSE namespace indexer.
Please contact modules@xxxxxxxx if there are any open questions.
Id: mldistwatch 925 2007-09-16 15:41:11Z k

User: HMBRAND (H.Merijn Brand)
Distribution file: Text-CSV_XS-0.32.tgz

Well, I'm pleased to see you here :-)
I tried to use your module Text::CSV_XS for storing some data to CSV file but without success. The problem is national characters. When I tried $csv->combine(('abc',áíá','def') I got "abc\n" only. Your module fail on first field where something greather then \x7f is. But no error, no warning.
Is this a bug or feature?


This sort-of works for me:

#!/usr/bin/perl
use strict;
use warnings;
use encoding 'iso-8859-1';
use Text::CSV_XS 0.32;

print "Version = $Text::CSV_XS::VERSION\n";

my $csv = Text::CSV_XS->new({binary => 1});
$csv->combine('abc','áíá','def') or warn("problem: $!\n");
print $csv->string(), "\n";

__END__

However, the output seems to be forced to UTF-8:

Version = 0.32
abc,áíá,def

The above is properly interpreted in utf-8 as this:

Version = 0.32
abc,áíá,def

So Text::CSV_XS seems to ignore both the script encoding and the locale. I had set LANG=en_US.ISO-8859-1 in Linux before running the script.

And no error message is placed into $! upon error. I know, this is in the TODO section :-)

.



Relevant Pages

  • Re: Warning: commit message does not conform to UTF-8. (mmotm "10-Nov-2007 22:46")
    ... Warning: commit message does not conform to UTF-8. ... ERROR: Invalid UTF-8 ...
    (Linux-Kernel)
  • Re: Thoughts on Fedora
    ... > happened without warning. ... Mot sure what you mean "with no warnging". ... The UTF-8 thing has been ...
    (RedHat)
  • Re: Internet
    ... 'characters not found' warning in Thunderbird and clicked 'send anyway'. ... This message sent with UTF encoding. ... If you could stick to UTF-8 that would be great; ...
    (uk.comp.sys.mac)
  • Re: Accents in math operators
    ... LaTeX Warning: Command \~ invalid in math mode on input line 8. ... I get the same behaviour when I use an UTF-8 encoded file but tell ... LaTeX that it is Latin-1. ... That does work with or without lmodern. ...
    (comp.text.tex)