Skip Menu |
 

This queue is for tickets about the File-Slurp CPAN distribution.

Report information
The Basics
Id: 28490
Status: resolved
Priority: 0/
Queue: File-Slurp

People
Owner: Nobody in particular
Requestors: allard [...] byte.nl
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.01
  • 2001.1103
  • 2002.0305
  • 2002.1031
  • 2004.0904
  • 96.042202
  • 98.071901
  • 9999.01
  • 9999.02
  • 9999.03
  • 9999.04
  • 9999.06
  • 9999.07
  • 9999.08
  • 9999.09
  • 9999.10
  • 9999.11
  • 9999.12
Fixed in: (no value)

Attachments


Download (untitled) / with headers
text/plain 314b
Dear Maintainer, File::Slurp does not support reading from or writing to files that use multibyte character sets. The manual even says so :) Even still, the patch to support this is stunningly simple. Please apply the patch. Regards, Allard Hoeve PS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=429933
Subject: libfile-slurp-perl_binmode.patch
--- /usr/share/perl5/File/Slurp.pm.orig 2005-04-19 07:12:40.000000000 +0200 +++ /usr/share/perl5/File/Slurp.pm 2007-06-21 12:37:36.000000000 +0200 @@ -65,7 +65,6 @@ # a regular file. set the sysopen mode my $mode = O_RDONLY ; - $mode |= O_BINARY if $args{'binmode'} ; # open the file and handle any error @@ -75,6 +74,8 @@ goto &error ; } + binmode($read_fh, $args{'binmode'}) if $args{'binmode'}; + # get the size of the file for use in the read loop $size_left = -s $read_fh ; @@ -210,7 +211,6 @@ # set the mode for the sysopen my $mode = O_WRONLY | O_CREAT ; - $mode |= O_BINARY if $args->{'binmode'} ; $mode |= O_APPEND if $args->{'append'} ; $mode |= O_EXCL if $args->{'no_clobber'} ; @@ -221,6 +221,8 @@ @_ = ( $args, "write_file '$file_name' - sysopen: $!"); goto &error ; } + + binmode($write_fh, $args->{'binmode'}) if $args->{'binmode'}; } sysseek( $write_fh, 0, SEEK_END ) if $args->{'append'} ; @@ -435,10 +437,8 @@ mode. my $bin_data = read_file( $bin_file, binmode => ':raw' ) ; - -NOTE: this actually sets the O_BINARY mode flag for sysopen. It -probably should call binmode and pass its argument to support other -file modes. + # Or + my $bin_data = read_file( $bin_file, binmode => ':utf8' ) ; =head3 array_ref @@ -537,10 +537,8 @@ mode. write_file( $bin_file, {binmode => ':raw'}, @data ) ; - -NOTE: this actually sets the O_BINARY mode flag for sysopen. It -probably should call binmode and pass its argument to support other -file modes. + # Or + write_file( $bin_file, {binmode => ':utf8'}, @data ) ; =head3 buf_ref
fixed


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.