From 659fdf41d41a67d86eeaea1b0386aed2363240f5 Mon Sep 17 00:00:00 2001 From: tetragon Date: Thu, 11 Oct 2007 15:08:11 +0000 Subject: UTF-8 text output fixes and removing extra newline in disposition-free output git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1742 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Template.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'LedgerSMB/Template.pm') diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm index 59deb5a3..8c302e91 100755 --- a/LedgerSMB/Template.pm +++ b/LedgerSMB/Template.pm @@ -254,19 +254,19 @@ sub _http_output { throw Error::Simple "Invalid format"; } my $format = "LedgerSMB::Template::$self->{format}"; - my $disposition = "\n"; + my $disposition = ""; my $name = $format->can('postprocess')->($self); if ($name) { $name =~ s#^.*/##; - $disposition .= qq|Content-Disposition: attachment; filename="$name"|; + $disposition .= qq|\nContent-Disposition: attachment; filename="$name"|; } if ($self->{mimetype} =~ /^text/) { print "Content-Type: $self->{mimetype}; charset=utf-8$disposition\n\n"; } else { print "Content-Type: $self->{mimetype}$disposition\n\n"; + binmode STDOUT, ':bytes'; } - binmode STDOUT, ':bytes'; print $data; binmode STDOUT, ':utf8'; } -- cgit v1.2.3