ZIP-Dateien raw auf STDOUT ausgeben
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Dec 2010 09:28:29 +0000 (10:28 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Dec 2010 09:34:42 +0000 (10:34 +0100)
bin/mozilla/datev.pl

index 4ada35f..d352252 100644 (file)
@@ -421,11 +421,13 @@ sub download {
   chdir($cwd);
 
   open(IN, $tmp_name) || die("open $tmp_name");
-  print("Content-Type: application/zip\n");
-  print("Content-Disposition: attachment; filename=\"${zip_name}\"\n\n");
-  while (<IN>) {
-    print($_);
-  }
+  $::locale->with_raw_io(\*STDOUT, sub {
+    print("Content-Type: application/zip\n");
+    print("Content-Disposition: attachment; filename=\"${zip_name}\"\n\n");
+    while (<IN>) {
+      print($_);
+    }
+  });
   close(IN);
 
   unlink($tmp_name);