#################################################################################
#use Data::Dumper; print Dumper(\%Opt);
use Encode;
-binmode( STDOUT, "raw:" );
-# NB 13.12.23 binmode( STDOUT, "utf8:" );
-
#
# Calculate lengths
use Encode;
my $ENCODE = 1;
binmode STDOUT, ":utf8" if $ENCODE;
+#binmode STDOUT, "raw:";
#binmode STDOUT;
sub realLength() {
- #return scalar( map $_, $_[0] =~ /(.)/gs );
- #my $l = length($_[0]);
- #my $l = bytes::length($_[0]);
$_[0] = Encode::decode_utf8($_[0]) if $ENCODE;
- #return $l;
return length($_[0]);
- #$F[$i] = Encode::encode_utf8($F[$i]);
- #return bytes::length($_[0]);
}
while (<>) {
$sep_line = Encode::decode("UTF-8",$sep_line);
$sep_line_last = Encode::decode("UTF-8",$sep_line_last);
}
-# NB 23.01.24 my $format = "| ".join(" | ",map {$t+=$_+3; "\%-".$_."s"} @len)." |".chr(10);
-# NB 23.01.24 my $sep_line = "+".join("+",map {("-"x($_+2))} @len)."+".chr(10);
-# NB 23.01.24 my $sep_line_first = $sep_line;
-# NB 23.01.24 my $sep_line_last = $sep_line;
#
# Format / align
}
printf $format,@$line;
- # NB 23.01.24 printf $format,map{$ENCODE ? Encode::encode_utf8($_) : $_} @$line;
print $sep_line if $Opt{header} and !$i++;
}