Text::CSV with Special Chars? 
Author Message
 Text::CSV with Special Chars?

It seems that the $csv->combine() method will not work if your array
has any special characters. For example, my test with a field as
'Vitria' will not work.

Is there a reason why this module has to fail for special chars?  What
alternatives are there?



Sat, 27 Mar 2004 04:43:37 GMT  
 Text::CSV with Special Chars?
Have you tried Text-CSV_XS?
Quote:
> It seems that the $csv->combine() method will not work if your array
> has any special characters. For example, my test with a field as
> 'Vitria' will not work.

> Is there a reason why this module has to fail for special chars?  What
> alternatives are there?



Sat, 27 Mar 2004 12:52:28 GMT  
 Text::CSV with Special Chars?

Quote:

> It seems that the $csv->combine() method will not work if your array
> has any special characters. For example, my test with a field as
> 'Vitria' will not work.use Text::CSV_XS;

  use Text::CSV_XS;
  my $csv = Text::CSV_XS->new;
  $csv->{binary}=1;


  print $csv->string;

Quote:
> What alternatives are there?

  use AnyData::Format::CSV;
  my $csv = AnyData::Format::CSV->new;


Both methods print out: foo,bar,"""stuff""",Vitria and both could use
other escape characters, eols, field separators, or quote characters if
you supply them.

--
Jeff



Sat, 27 Mar 2004 17:42:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Replacing special chars with special chars

2. DBD::CSV or TEXT::CSV

3. Text::ParseWords or Text::CSV

4. Shell special chars in file names?

5. pattern matching with special char

6. escape special chars before loading into MySQL

7. Special chars

8. special chars

9. about special chars when split()

10. perl/sendmail: encoding special chars

11. Counting number of chars in a line (part of reading multiline CSV

12. is there a way to escape special chars

 

 
Powered by phpBB® Forum Software