projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Aufträge - Abteilung per ALL_DEPARTMENTS und L.select_tag
[kivitendo-erp.git]
/
SL
/
ReportGenerator.pm
diff --git
a/SL/ReportGenerator.pm
b/SL/ReportGenerator.pm
index
368e695
..
2e12a2a
100644
(file)
--- a/
SL/ReportGenerator.pm
+++ b/
SL/ReportGenerator.pm
@@
-47,6
+47,7
@@
sub new {
'escape_char' => '"',
'eol_style' => 'Unix',
'headers' => 1,
'escape_char' => '"',
'eol_style' => 'Unix',
'headers' => 1,
+ 'encoding' => 'UTF-8',
},
};
$self->{export} = {
},
};
$self->{export} = {
@@
-287,7
+288,7
@@
sub prepare_html_content {
'align' => $column->{align},
'link' => $column->{link},
'text' => $column->{text},
'align' => $column->{align},
'link' => $column->{link},
'text' => $column->{text},
- 'raw_
data' => $column->{raw
_data},
+ 'raw_
header_data' => $column->{raw_header
_data},
'show_sort_indicator' => $name eq $opts->{sort_indicator_column},
'sort_indicator_direction' => $opts->{sort_indicator_direction},
};
'show_sort_indicator' => $name eq $opts->{sort_indicator_column},
'sort_indicator_direction' => $opts->{sort_indicator_direction},
};
@@
-703,10
+704,10
@@
sub _print_content {
}
sub _handle_quoting_and_encoding {
}
sub _handle_quoting_and_encoding {
- my ($self, $text, $do_unquote) = @_;
+ my ($self, $text, $do_unquote
, $encoding
) = @_;
$text = $main::locale->unquote_special_chars('HTML', $text) if $do_unquote;
$text = $main::locale->unquote_special_chars('HTML', $text) if $do_unquote;
- $text = Encode::encode('UTF-8', $text);
+ $text = Encode::encode(
$encoding ||
'UTF-8', $text);
return $text;
}
return $text;
}
@@
-745,7
+746,7
@@
sub _generate_csv_content {
if ($opts->{headers}) {
if (!$self->{custom_headers}) {
if ($opts->{headers}) {
if (!$self->{custom_headers}) {
- $csv->print($stdout, [ map { $self->_handle_quoting_and_encoding($self->{columns}->{$_}->{text}, 1) } @visible_columns ]);
+ $csv->print($stdout, [ map { $self->_handle_quoting_and_encoding($self->{columns}->{$_}->{text}, 1
, $opts->{encoding}
) } @visible_columns ]);
} else {
foreach my $row (@{ $self->{custom_headers} }) {
} else {
foreach my $row (@{ $self->{custom_headers} }) {
@@
-753,7
+754,7
@@
sub _generate_csv_content {
foreach my $col (@{ $row }) {
my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
foreach my $col (@{ $row }) {
my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1;
- push @{ $fields }, ($self->_handle_quoting_and_encoding($col->{text}, 1)) x $num_output;
+ push @{ $fields }, ($self->_handle_quoting_and_encoding($col->{text}, 1
, $opts->{encoding}
)) x $num_output;
}
$csv->print($stdout, $fields);
}
$csv->print($stdout, $fields);
@@
-775,7
+776,7
@@
sub _generate_csv_content {
my $num_output = ($row->{$col}{colspan} && ($row->{$col}->{colspan} > 1)) ? $row->{$col}->{colspan} : 1;
$skip_next = $num_output - 1;
my $num_output = ($row->{$col}{colspan} && ($row->{$col}->{colspan} > 1)) ? $row->{$col}->{colspan} : 1;
$skip_next = $num_output - 1;
- push @data, join($eol, map { s/\r?\n/$eol/g; $self->_handle_quoting_and_encoding($_, 0) } @{ $row->{$col}->{data} });
+ push @data, join($eol, map { s/\r?\n/$eol/g; $self->_handle_quoting_and_encoding($_, 0
, $opts->{encoding}
) } @{ $row->{$col}->{data} });
push @data, ('') x $skip_next if ($skip_next);
}
push @data, ('') x $skip_next if ($skip_next);
}
@@
-1026,6
+1027,10
@@
End of line style. Default is Unix.
Include headers? Default is yes.
Include headers? Default is yes.
+=item encoding
+
+Character encoding. Default is UTF-8.
+
=back
=head1 SEE ALO
=back
=head1 SEE ALO