[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4123] branches/1.3/LedgerSMB/Template.pm



Revision: 4123
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4123&view=rev
Author:   tshvr
Date:     2011-12-01 21:37:39 +0000 (Thu, 01 Dec 2011)
Log Message:
-----------
avoid message utf8 \xFD does not map to Unicode at LedgerSMB/Template.pm line 342, <DATA> line nnn.

Modified Paths:
--------------
    branches/1.3/LedgerSMB/Template.pm

Modified: branches/1.3/LedgerSMB/Template.pm
===================================================================
--- branches/1.3/LedgerSMB/Template.pm	2011-12-01 13:20:51 UTC (rev 4122)
+++ branches/1.3/LedgerSMB/Template.pm	2011-12-01 21:37:39 UTC (rev 4123)
@@ -331,11 +331,21 @@
 
 	if (!defined $data and defined $self->{rendered}){
 		$data = "";
+                $logger->trace("begin DATA < self->{rendered}=$self->{rendered} \$self->{format}=$self->{format}");
 		open (DATA, '<', $self->{rendered});
-                binmode DATA, ':utf8';
+                #avoiding utf8 "\xCD" does not map to Unicode at LedgerSMB/Template.pm line 342, <DATA> line 155.
+                if($self->{format} eq 'LaTeX')
+                {
+                 binmode DATA, ':raw';
+                }
+                else
+                {
+                 binmode DATA, ':utf8';
+                }
 		while (my $line = <DATA>){
 			$data .= $line;
 		}
+                $logger->trace("end DATA < self->{rendered}");
 	        unlink($self->{rendered}) or throw Error::Simple 'Unable to delete output file';
 	}
 
@@ -354,8 +364,17 @@
 		print "Content-Type: $self->{mimetype}$disposition\n\n";
 	    }
         }
-	binmode STDOUT, ':utf8';
+        $logger->trace("begin print to STDOUT");
+        if($self->{format} eq 'LaTeX')
+        {
+         binmode STDOUT, ':raw';
+        }
+        else
+        {
+         binmode STDOUT, ':utf8';
+        }
 	print $data;
+        $logger->trace("end print to STDOUT");
 }
 
 sub _http_output_file {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.