develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33664 - branches/pdd22io_part2/src/pmc

From:
allison
Date:
December 8, 2008 11:48
Subject:
[svn:parrot] r33664 - branches/pdd22io_part2/src/pmc
Message ID:
20081208194853.2A325CB9AF@x12.develooper.com
Author: allison
Date: Mon Dec  8 11:48:52 2008
New Revision: 33664

Modified:
   branches/pdd22io_part2/src/pmc/filehandle.pmc

Log:
[pdd22io] Keep the encoding set on temporary filehandle for 'readall' on an
existing FileHandle object.


Modified: branches/pdd22io_part2/src/pmc/filehandle.pmc
==============================================================================
--- branches/pdd22io_part2/src/pmc/filehandle.pmc	(original)
+++ branches/pdd22io_part2/src/pmc/filehandle.pmc	Mon Dec  8 11:48:52 2008
@@ -295,12 +295,15 @@
         if (got_name) {
             /* called as class method - open, slurp, close file */
             PMC *filehandle;
+            STRING *encoding;
+            GET_ATTR_encoding(INTERP, SELF, encoding);
             size_t size;
             if (!Parrot_io_is_closed(INTERP, SELF)) {
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
                                 "Cannot readall on a new file from an already open filehandle");
             }
             filehandle  = Parrot_io_open(INTERP, PMCNULL, name, NULL);
+            SET_ATTR_encoding(INTERP, filehandle, encoding);
             size = (size_t)(Parrot_stat_info_intval(INTERP, name, STAT_FILESIZE));
 
             result = Parrot_io_reads(INTERP, filehandle, size);



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About