summaryrefslogtreecommitdiffstats
path: root/email_in.pl
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-11-23 13:58:33 +0100
committermkanat%bugzilla.org <>2007-11-23 13:58:33 +0100
commit9f0310bf8c0821347699b434f659eb52decabf87 (patch)
tree31153ecb72f2b57a9bb3daf638cc4e1152f8a0b0 /email_in.pl
parent8ab75a83c21606ad77a38c05057f886011fa0451 (diff)
downloadbugzilla-9f0310bf8c0821347699b434f659eb52decabf87.tar.gz
bugzilla-9f0310bf8c0821347699b434f659eb52decabf87.tar.xz
Bug 363153: Turn on the utf8 bit on all strings in Bugzilla that contain
non-ASCII data, if the utf8 parameter is on. This means that string functions like substr() work properly on multi-byte languages, now. Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wurblzap, a=mkanat
Diffstat (limited to 'email_in.pl')
-rw-r--r--email_in.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/email_in.pl b/email_in.pl
index 7b8232192..97fea4847 100644
--- a/email_in.pl
+++ b/email_in.pl
@@ -38,7 +38,7 @@ use Email::MIME;
use Email::MIME::Attachment::Stripper;
use Getopt::Long qw(:config bundling);
use Pod::Usage;
-use Encode qw(encode decode);
+use Encode;
use Bugzilla;
use Bugzilla::Bug qw(ValidateBugID);
@@ -306,8 +306,8 @@ sub get_text_alternative {
debug_print("Part Character Encoding: $charset", 2);
if (!$ct || $ct =~ /^text\/plain/i) {
$body = $part->body;
- if (Bugzilla->params->{'utf8'}) {
- $body = encode('UTF-8', decode($charset, $body));
+ if (Bugzilla->params->{'utf8'} && !utf8::is_utf8($body)) {
+ $body = Encode::decode($charset, $body);
}
last;
}