Text::...eGuess(3pm)
β¨ NAME β¨
Text::CSV::Encoded::Coder::EncodeGuess β it's a Text::CSV::Encoded coder class that uses Encode::Guess π
okay bestie, quick vibe check: this is the Text::...eGuess(3pm) page, straight outta User Contributed Perl Documentation. let's go π¦
πΈ VERSION πΈ
version 0.25 β¨
π SYNOPSIS π
use Text::CSV::Encoded coder_class => 'Text::CSV::Encoded::Coder::EncodeGuess';
use Spreadsheet::ParseExcel;
my $csv = Text::CSV::Encoded->new();
$csv->encoding( ['ucs2', 'ascii'] ); # guessing ucs2 or ascii?
$csv->encoding_to_combine('shiftjis');
my $excel = Spreadsheet::ParseExcel::Workbook->Parse( $file );
my $sheet = $excel->{Worksheet}->[0];
for my $row ( $sheet->{MinRow} .. $sheet->{MaxRow} ) {
my @fields;
for my $col ( $sheet->{MinCol} .. $sheet->{MaxCol} ) {
my $cell = $sheet->{Cells}[$row][$col];
push @fields, $cell->{Val};
}
$csv->combine( @fields ) or die;
print $csv->string, "\n";
}
π DESCRIPTION π
This module is inherited from Text::CSV::Encoded::Coder::Encode. that's it, that's the whole description, she's a nepo baby and we love her for it π
π«Ά USE π«Ά
Except for 2 attributes, it's literally the same as Text::CSV::Encoded::Coder::Encode. two little special ones. those are the ones we're about to talk about, so stay with me π§
β encoding_in β
$csv = $csv->encoding_in( $encoding_list_ref );
The accessor to an encoding for pre-parsing CSV strings. If no encoding is given, it returns the current $encoding, otherwise it hands you back the object itself. (yes, chainable. slay π
)
$encoding_list_ref = $csv->encoding_in()
When you pass a list reference, it might guess the encoding from the given list π
$csv->encoding_in( ['shiftjis', 'euc-jp', 'iso-20022-jp'] );
If it cannot guess the encoding, the first encoding of the list is used. no cap, it just defaults to the first one fr fr
π encoding π
$csv = $csv->encoding( $encoding_list_ref );
$encoding_list_ref = $csv->encoding();
You can pass a list reference to this attribute only, and by "only" I mean:
- For list data consumed by
combine(). - For list reference returned by
getline().
In other word β in combine and print β it might guess an encoding for the passing list data π If it cannot guess the encoding, the first encoding of the list is used. same deal as above, bestie π€
π¦ SEE ALSO π¦
Encode, Encode::Guess β go read those too, they're the moment β¨
π AUTHOR π
Makamaka Hannyaharamitu, <makamaka[at]cpan.org> π«Ά
π COPYRIGHT AND LICENSE π
Copyright 2008-2013 by Makamaka Hannyaharamitu.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π this absolute icon dropped with perl v5.36.0 on 2022-11-19, and yeah, the page name up top is the cursed truncated Text::...eGuess(3pm) version, iykyk πβ¨ periodt πΈ
π¦ where this page comes from
- debian bookworm: libtext-csv-encoded-perl 0.25-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtext-csv-encoded-perl 0.25-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-csv-encoded-perl 0.25-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtext-csv-encoded-perl 0.25-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-csv-encoded-perl 0.25-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms