summaryrefslogtreecommitdiff
path: root/rt/lib/RT/I18N.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/I18N.pm')
-rw-r--r--rt/lib/RT/I18N.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/rt/lib/RT/I18N.pm b/rt/lib/RT/I18N.pm
index 11cd5f1..de93512 100644
--- a/rt/lib/RT/I18N.pm
+++ b/rt/lib/RT/I18N.pm
@@ -2,7 +2,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -245,7 +245,10 @@ sub SetMIMEEntityToEncoding {
. $head->mime_type . " - "
. ( Encode::decode("UTF-8",$head->get('subject')) || 'Subjectless message' ) );
- Encode::from_to( $string, $charset => $enc );
+ {
+ no warnings 'utf8';
+ $string = Encode::encode( $enc, Encode::decode( $charset, $string) );
+ }
my $new_body = MIME::Body::InCore->new($string);
@@ -549,7 +552,8 @@ sub SetMIMEHeadToEncoding {
$head->delete($tag);
foreach my $value (@values) {
if ( $charset ne $enc || $enc =~ /^utf-?8(?:-strict)?$/i ) {
- Encode::from_to( $value, $charset => $enc );
+ no warnings 'utf8';
+ $value = Encode::encode( $enc, Encode::decode( $charset, $value) );
}
$value = DecodeMIMEWordsToEncoding( $value, $enc, $tag )
unless $preserve_words;