From: Don Armstrong Date: Sun, 8 Jul 2012 02:58:28 +0000 (-0700) Subject: Only use decode_utf8 if the string isn't already in perl's internal encoding X-Git-Tag: release/2.6.0~380 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=82c16ff41e7bc03347c2d9c685e5af8f585f9f61;hp=bbc75bd2086151570f0d7f70c971618ec736a293;p=debbugs.git Only use decode_utf8 if the string isn't already in perl's internal encoding --- diff --git a/Debbugs/MIME.pm b/Debbugs/MIME.pm index c2faeaa..e94733e 100644 --- a/Debbugs/MIME.pm +++ b/Debbugs/MIME.pm @@ -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