]> git.donarmstrong.com Git - debbugs.git/commitdiff
Only use decode_utf8 if the string isn't already in perl's internal encoding
authorDon Armstrong <don@donarmstrong.com>
Sun, 8 Jul 2012 02:58:28 +0000 (19:58 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 8 Jul 2012 02:58:28 +0000 (19:58 -0700)
Debbugs/MIME.pm

index c2faeaa8621b3f5c580beb5c450425c1d39f9b6c..e94733ee016db8de4213700a7581bb3b6a00e285 100644 (file)
@@ -313,7 +313,7 @@ sub encode_rfc1522 {
               if (length $encoded > 75) {
                    # Turn utf8 into the internal perl representation
                    # so . is a character, not a byte.
-                   my $tempstr = decode_utf8($word,Encode::FB_DEFAULT);
+                   my $tempstr = is_utf8($word)?$word:decode_utf8($word,Encode::FB_DEFAULT);
                    my @encoded;
                    # Strip it into 10 character long segments, and encode
                    # the segments