Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Text::CSV_XS and encoding

by PeterKaagman (Sexton)
on Sep 16, 2018 at 15:58 UTC ( [id://1222469]=note: print w/replies, xml ) Need Help??


in reply to Re: Text::CSV_XS and encoding
in thread Text::CSV_XS and encoding

Version 1.21-1 from the Ubunto repro.
Will reinstall from CPAN and try again.
Thanks.... did not think of that.

Replies are listed 'Best First'.
Re^3: Text::CSV_XS and encoding
by Tux (Canon) on Sep 17, 2018 at 06:31 UTC

    The detect_bom attribute was added in 1.22. I must admit the the ChangeLog was not very clear about that, as it was part of the new header works and naming all attributes to that didn't look very useful at the time. The docs clearly state:

    BOM (or Byte Order Mark) handling is available only inside the "header" method.

    The BOM-related changes in versions 1.25, 1.31, 1.33, 1.34, and 1.35 make its use more reliable. Note that BOM-handling is unreliable (or nor working at all) in perl-5.6.x.


    Enjoy, Have FUN! H.Merijn

      The thing which triggered my interest in BOM detection was an ugly escape sequence at the very beginning of my original data stream. I suspected it to be a BOM. I was kinda hoping BOM detection would get it out of the way. Otherwise I've got to come up with some other way of stripping it off.

        Post the results of this program to show what those bytes at the beginning of the file are.

        #!/usr/bin/perl use strict; use Devel::Peek; open my $FH, "<:raw", "./test2.csv" or die "./test.csv $!"; my $line = <$FH>; Dump $line;
        poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 22:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found