|
Posted by H.Merijn Brand on October 24, 2007, 7:51 am
Please log in for more thread options
The following report has been written by the PAUSE namespace indexer.
Please contact modules@perl.org 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
Number of files: 28
*.pm files: 1
README: Text-CSV_XS-0.32/README
META.yml: Text-CSV_XS-0.32/META.yml
Timestamp of file: Wed Oct 24 11:26:57 2007 UTC
Time of this run: Wed Oct 24 11:28:25 2007 UTC
* Added $csv->error_diag () to SYNOPSIS
* Added need for diag when new () fails to TODO
* Fixed a sneaked-in defined or in examples/csv2xls
* Plugged a 32byte memory leak in the cache code (valgrind++)
* Some perlcritic level1 changes
* Removed prototypes in examples/csv2xls
* Improved usage for examples/csv2xls (GetOpt::Long now does
--help/-?)
* Extended examples/csv2xls to deal with Unicode (-u)
* Serious bug in Text::CSV_XS::NV () type setting, causing the
resulting field to be truncated to IV
* ,\rx, is definitely an error without binary (used to HANG!)
* Fixed bug in attribute caching for undefined eol
* Cleaned up some code after -W*** warnings
* Added verbatim.
* More test to cover the really dark corners and edge cases
* Even more typo fixes in the docs
* Added error_diag ()
* Added t/80_diag.t - Will not be mirrored by Text::CSV_PP
* Added DIAGNOSTICS section to pod - Will grow
* Small pod niot (abeltje)
* Doc fix in TODO (Miller Hall)
|
|
Posted by Petr Vileta on October 25, 2007, 12:59 am
Please log in for more thread options
H.Merijn Brand wrote:
> The following report has been written by the PAUSE namespace indexer.
> Please contact modules@perl.org 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?
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
|
|
Posted by Mumia W. on October 26, 2007, 3:16 am
Please log in for more thread options 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@perl.org 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 :-)
|
|
Posted by Petr Vileta on October 27, 2007, 12:12 am
Please log in for more thread options Mumia W. wrote:
> On 10/24/2007 11:59 PM, Petr Vileta wrote:
>> 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});
I suppose that binari is intended for "unprintable" characters.
>
> However, the output seems to be forced to UTF-8:
>
I can't to use utf-8, I must use iso-8859-1 for some reason.
> 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.
Hmm, ignore but not thoroughly :-) I avoid using combine() finction by this
sub
sub mycombine
{
my @fileds=@_;
my $line = '';
foreach (@fileds)
{
s/\"/\"\"/g;
$line .= '"' . $_ . '"';
}
$line .= chr(13) . $chr(10);
return $line;
}
Ys, of course, this not look to filed type (number or string) but for my
intention this is sufficient. This work with program and locales settings.
Maybe will be good to add some functions to your module to set up input and
output codepages. Some like
$csv = $csv = Text::CSV_XS->new('input_charser' => 'utf-8', 'output_charset
=> 'iso-8859-1');
But this is my idea only ;-)
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
|
|
Posted by Mumia W. on October 27, 2007, 3:38 am
Please log in for more thread options On 10/26/2007 11:12 PM, Petr Vileta wrote:
> [...]
> I avoid using combine() finction by
> this sub
>
> sub mycombine
> {
> my @fileds=@_;
> my $line = '';
> foreach (@fileds)
> {
> s/\"/\"\"/g;
> $line .= '"' . $_ . '"';
> }
> $line .= chr(13) . $chr(10);
> return $line;
> }
>
> Ys, of course, this not look to filed type (number or string) but for my
> intention this is sufficient. This work with program and locales
> settings. Maybe will be good to add some functions to your module to set
> up input and output codepages. Some like
> $csv = $csv = Text::CSV_XS->new('input_charser' => 'utf-8',
> 'output_charset => 'iso-8859-1');
> But this is my idea only ;-)
I've just discovered that this works perfectly for me:
#!/usr/bin/perl
use strict;
use warnings;
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__
The above code outputs latin1 characters as expected.
For some reason, Text::CSV_XS doesn't like the encoding pragma:
#!/usr/bin/perl
use strict;
use warnings;
use encoding 'latin1';
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__
The above outputs utf8-data; "áíá" is converted into "áÃá"
However, if "binmode(STDOUT, ':encoding(latin1)');" is placed before the
print commands, the output is correct. I don't know if this is a bug in
Text::CSV_XS or not.
This is with Perl 5.8.4 and Text::CSV_XS 0.32. I had set
LANG=en_US.ISO-8859-1 under Linux.
|
| Similar Threads | Posted | | ANNOUNCE: Text::Iconv 1.4 | July 18, 2004, 1:41 am |
| ANNOUNCE: Text-Bidi-0.01 | August 28, 2006, 2:08 pm |
| [ANNOUNCE] Text-CSV_XS 0.25 | May 7, 2007, 11:22 am |
| ANNOUNCE Text::CSV_XS 0.26 | May 15, 2007, 7:28 am |
| ANNOUNCE: Text::CSV_XS 0.26 | May 15, 2007, 7:30 am |
| ANNOUNCE: Text-CSV_XS 0.28 | June 4, 2007, 6:56 am |
| ANNOUNCE: Text-CSV_XS 0.28 | June 4, 2007, 6:54 am |
| ANNOUNCE: Text::CSV_XS 0.29 | June 8, 2007, 6:29 am |
| ANNOUNCE: Text-CSV_XS 0.29 | June 8, 2007, 6:36 am |
| Announce: Text::CSV_XS 0.30 | June 21, 2007, 7:24 am |
|