in reply to Re^4: Text::CSV encoding parse()
in thread Text::CSV encoding parse()
I don't see any mention of any encoding in this code, which is not good. And earlier you said: "I'm using the CGI module and have it properly set: print $q->header(-charset => 'utf-8');" so I doubt this code is representative.
You need to:
Text::CSV is not the problem:
use warnings; use strict; use Devel::Peek; use Text::CSV; my $str = "\N{U+20AC}|\N{U+20AC}"; Dump($str); # ... UTF8 "\x{20ac}|\x{20ac}" ... my ($s1,$s2) = split /\|/, $str; Dump($s1); # ... UTF8 "\x{20ac}" ... Dump($s2); # ... UTF8 "\x{20ac}" ... my $csv = Text::CSV->new ({ binary => 1, sep_char => "|" }); $csv->parse($str); my ($c1,$c2) = $csv->fields; Dump($c1); # ... UTF8 "\x{20ac}" ... Dump($c2); # ... UTF8 "\x{20ac}" ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Text::CSV encoding parse()
by slugger415 (Monk) on Aug 14, 2019 at 21:41 UTC | |
by haukex (Archbishop) on Aug 15, 2019 at 06:43 UTC | |
by Tux (Canon) on Aug 15, 2019 at 07:53 UTC | |
by haukex (Archbishop) on Aug 15, 2019 at 08:26 UTC | |
by slugger415 (Monk) on Aug 16, 2019 at 18:35 UTC | |
by haukex (Archbishop) on Aug 17, 2019 at 06:47 UTC | |
by slugger415 (Monk) on Aug 20, 2019 at 17:25 UTC | |
| |
by jcb (Parson) on Aug 14, 2019 at 23:16 UTC |