Skip Menu |

This queue is for tickets about the XML-Dumper CPAN distribution.

Report information
The Basics
Id: 47452
Status: new
Priority: 0/
Queue: XML-Dumper

People
Owner: Nobody in particular
Requestors: nigel.metheringham [...] Dev.intechnology.co.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.81
Fixed in: (no value)



When .xml.gz data is saved, the file is opened with utf8 encoding, which is definitely wrong, and causes some perl versions (Strawberry 5.8.9) to write data which cannot be decoded. Attached patch fixes. [Bug interface is playing up for me today, so this bug report might be malformed]
Subject: XML-Dumper-compressed-filemode.patch
From 9739542cbb0542b673e6c2a30496b1dd4ee84b3f Mon Sep 17 00:00:00 2001 From: Nigel Metheringham <nigel.metheringham@dev.intechnology.co.uk> Date: Tue, 30 Jun 2009 10:01:04 +0100 Subject: [PATCH] Changed output gz file to be :raw rather than :utf8 --- Dumper.pm | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dumper.pm b/Dumper.pm index 04cff10..ed9ecb3 100644 --- a/Dumper.pm +++ b/Dumper.pm @@ -439,8 +439,8 @@ Usage: See Synopsis if( $file =~ /\.xml\.gz$/i ) { if( $COMPRESSION_AVAILABLE ) { my $compressed_xml = Compress::Zlib::memGzip( $xml ) or die "Failed to compress xml $!"; - open FILE, ">:utf8", $file or die "Can't open '$file' for writing $!"; - binmode FILE; + open FILE, ">:raw", $file or die "Can't open '$file' for writing $!"; + binmode FILE; # superflous with :raw above print FILE $compressed_xml; close FILE; @@ -454,8 +454,7 @@ Usage: See Synopsis close FILE; } } else { - no warnings; # to shut Perl up about Wide characters for UTF8 output - open FILE, ">$file" or die "Can't open '$file' for writing $!"; + open FILE, ">:utf8", $file or die "Can't open '$file' for writing $!"; print FILE $xml; close FILE; } -- 1.6.2.4