[Rt-commit] rt branch, 4.2/less-qp, created. rt-4.2.10-134-gf7f2c0b

Alex Vandiver alexmv at bestpractical.com
Thu Mar 5 14:31:33 EST 2015


The branch, 4.2/less-qp has been created
        at  f7f2c0bc6a3ecbfbd1770110cd5885e68b340624 (commit)

- Log -----------------------------------------------------------------
commit f7f2c0bc6a3ecbfbd1770110cd5885e68b340624
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Mar 5 14:31:04 2015 -0500

    TESTING: Only QP when the bytes are invalid UTF-8

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index d65ecab..e9b6085 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -787,6 +787,7 @@ sub _EncodeLOB {
 
     #if the current attachment contains nulls and the
     #database doesn't support embedded nulls
+    local $@;
 
     if ( ( !$RT::Handle->BinarySafeBLOBs ) && ( $Body =~ /\x00/ ) ) {
 
@@ -799,7 +800,7 @@ sub _EncodeLOB {
     # Some databases (postgres) can't handle non-utf8 data
     } elsif (    !$RT::Handle->BinarySafeBLOBs
               && $Body =~ /\P{ASCII}/
-              && !Encode::is_utf8( $Body, 1 ) ) {
+              && !eval { Encode::decode( "UTF-8", $Body, Encode::FB_CROAK ) || 1} ) {
           $ContentEncoding = 'quoted-printable';
     }
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list