[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.8-292-g651defd

Alex Vandiver alexmv at bestpractical.com
Wed Dec 19 22:59:54 EST 2012


The branch, 4.0-trunk has been updated
       via  651defde80fffaf39cf0966ec0f446849e8885b2 (commit)
       via  bb7a2b53ac689c8394c75b27da04eff40197ad6b (commit)
       via  327336a5e88398f6b52161e9ade8661c8b80184c (commit)
       via  2435b8835700a304a87fe822022c05beb2dffaa0 (commit)
       via  2b863650c16d1b5ae872d60f29b72f128716b50c (commit)
       via  8a8aad65e142c89453221e37f989f627d6410b34 (commit)
      from  c397411fa354f3e61e86dd6cdbff8585321145cc (commit)

Summary of changes:
 lib/RT/I18N.pm                 | 28 ++++++++++++++---
 t/mail/not-supported-charset.t | 69 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 5 deletions(-)
 create mode 100644 t/mail/not-supported-charset.t

- Log -----------------------------------------------------------------
commit 651defde80fffaf39cf0966ec0f446849e8885b2
Merge: c397411 bb7a2b5
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 19 22:19:45 2012 -0500

    Merge branch '4.0/unknown-email-charset' into 4.0-trunk
    
    Conflicts:
    	lib/RT/I18N.pm

diff --cc lib/RT/I18N.pm
index fac2099,6230070..b5a5a7a
--- a/lib/RT/I18N.pm
+++ b/lib/RT/I18N.pm
@@@ -347,8 -358,15 +358,15 @@@ sub DecodeMIMEWordsToEncoding 
              }
  
              # now we have got a decoded subject, try to convert into the encoding
 -            unless ( $charset eq $to_charset ) {
 +            if ( $charset ne $to_charset || $charset =~ /^utf-?8(?:-strict)?$/i ) {
-                 Encode::from_to( $enc_str, $charset, $to_charset );
+                 if ( Encode::find_encoding($charset) ) {
+                     Encode::from_to( $enc_str, $charset, $to_charset );
+                 } else {
+                     $RT::Logger->warning("Charset '$charset' is not supported");
+                     $enc_str =~ s/[^[:print:]]/\357\277\275/g;
+                     Encode::from_to( $enc_str, 'UTF-8', $to_charset )
+                         unless $to_charset eq 'utf-8';
+                 }
              }
  
              # XXX TODO: RT doesn't currently do the right thing with mime-encoded headers

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


More information about the Rt-commit mailing list