From 2f087465e4bd4ffed8b295cf82d3cf48e69ca216 Mon Sep 17 00:00:00 2001 From: tetragon Date: Tue, 4 Dec 2007 20:01:13 +0000 Subject: Encoding fixes for the backup routines git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1939 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/AM.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm index 60d584a0..803a9f32 100644 --- a/LedgerSMB/AM.pm +++ b/LedgerSMB/AM.pm @@ -2087,7 +2087,7 @@ sub backup { "${LedgerSMB::Sysconfig::backuppath}/$boundary.$globalDBname-$form->{dbversion}-$t[5]$t[4]$t[3].sql"; $form->{OUT} = "$tmpfile"; - open( OUT, '>', "$form->{OUT}" ) or $form->error("$form->{OUT} : $!"); + open( OUT, '>:raw', "$form->{OUT}" ) or $form->error("$form->{OUT} : $!"); # get sequences, functions and triggers @@ -2132,8 +2132,9 @@ LedgerSMB|, if ( $form->{media} eq 'file' ) { - open( IN, '<', "$tmpfile" ) or $form->error("$tmpfile : $!"); + open( IN, '<:raw', "$tmpfile" ) or $form->error("$tmpfile : $!"); open( OUT, ">-" ) or $form->error("STDOUT : $!"); + binmode( OUT, ':raw' ); print OUT qq|Content-Type: application/file;\n| . qq|Content-Disposition: attachment; filename="$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql$suffix"\n\n|; @@ -2411,3 +2412,4 @@ sub get_all_defaults { 1; =back + -- cgit v1.2.3