in reply to CSV_XS and UTF8 strings
quote_space is just to decide if values that have space(s) are to be considered for quotation and has nothing to do with anything else.
$ perl -MText::CSV_XS -wE'Text::CSV_XS->new({binary=>1,auto_diag=>1,qu +ote_space=>0,eol=>"\n"})->print(*STDOUT,[undef,""," ",1,"a b "])' ,, ,1,a b $ perl -MText::CSV_XS -wE'Text::CSV_XS->new({binary=>1,auto_diag=>1,qu +ote_space=>1,eol=>"\n"})->print(*STDOUT,[undef,""," ",1,"a b "])' ,," ",1,"a b "
There is no option (yet) to prevent quotation for (valid) UTF8 other than the aforementioned undef, which will disable quotation altogether, which is wrong in most cases.
$ perl -MText::CSV_XS -C3 -wE'Text::CSV_XS->new({binary=>1,auto_diag=> +1,quote_space=>0,eol=>"\n"})->print(*STDOUT,[undef,""," ",1,"a b ","\ +x{20ac}"])' ,, ,1,a b ,"€" $ perl -MText::CSV_XS -C3 -wE'Text::CSV_XS->new({binary=>1,auto_diag=> +1,quote_space=>1,eol=>"\n"})->print(*STDOUT,[undef,""," ",1,"a b ","\ +x{20ac}"])' ,," ",1,"a b ","€"
Would you be so kind to explain why quotation around Unicode strings is wrong in your perception? In theory, quotation never harms.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CSV_XS and UTF8 strings
by beerman (Novice) on Oct 18, 2011 at 18:42 UTC | |
by tye (Sage) on Oct 18, 2011 at 18:57 UTC | |
by Tux (Canon) on Oct 19, 2011 at 06:44 UTC | |
by beerman (Novice) on Oct 19, 2011 at 16:46 UTC | |
by Tux (Canon) on Oct 19, 2011 at 17:35 UTC | |
by beerman (Novice) on Oct 19, 2011 at 21:41 UTC | |
|