Hi!
Our OTRS 1.3.2 installation runnig on Oracle is using UTF-8 as default
charset, since our customer has users from several different charsets
(and countries). :)
We've had some problems with sending Email in UTF-8. When the
characters in the email were translatable to latin-1 (or perhaps
latin-15 - didn't test with â), the body of the email came through as
latin-1, even though the headers insisted it was UTF-8. When the
email contained characters that wouldn't translate to latin-1 (greek,
chinese, czech...) it would croak with the message:
Wide character in syswrite at /usr/lib/perl5/5.8.3/Net/Cmd.pm line 430.!
I tried forcing it to use quoted printable, but that only seemed to
move the problem:
Wide character in subroutine entry at
/home/virtual-http/www.elkjop.int/otrs/Kernel/cpan-lib/MIME/Decoder/QuotedPrint.pm
line 74.!
After a bit of digging around, Googling, and doing semi-random changes
here and there, I stumbled over the Encode module, and the attached
patch seems to fix our problem:
Index: Kernel/System/Ticket/Article.pm
===================================================================
--- Kernel/System/Ticket/Article.pm (revision 37)
+++ Kernel/System/Ticket/Article.pm (revision 55)
@@ -12,6 +12,7 @@
use strict;
use MIME::Words qw(:all);
use MIME::Entity;
+use Encode;
use Mail::Internet;
use Kernel::System::StdAttachment;
use Kernel::System::Crypt;
@@ -709,7 +710,7 @@
=item ArticleIndex()
-returns an array with article id's
+returns an array with article ids
my @ArticleIDs = $TicketObject->ArticleIndex(
TicketID => 123,
@@ -1121,7 +1122,7 @@
my $Time = $Self->{TimeObject}->SystemTime();
my $Random = rand(999999);
my $ToOrig = $Param{To} || '';
- my $Charset = $Param{Charset} || 'iso-8859-1';
+ my $Charset = $Param{Charset} || $Self->{ConfigObject}->{DefaultCharset};
my $InReplyTo = $Param{InReplyTo} || '';
my $Loop = $Param{Loop} || 0;
my $HistoryType = $Param{HistoryType} || 'SendAnswer';
@@ -1249,7 +1250,10 @@
}
}
- my $Entity = MIME::Entity->build(%{$Header}, Data => $Param{Body});
+ my $Entity = MIME::Entity->build(%{$Header},
+ # dirty, nasty tricssss!
+ Data => encode($Self->{ConfigObject}->{DefaultCharset},
+ $Param{Body}));
# add attachments to email
if ($Param{Attach}) {
foreach my $Tmp (@{$Param{Attach}}) {
I don't know if anyone else has this problem as well, or if it's our
somewhat non-standard Oracle setup which is causing it, but if anyone
else is seeing the same problem, it might be worth a shot.
(Some of the changes in the patch is a bit unrelated to this problem,
though. The "'" in the comment had to go because it messed up my
editors Perl mode, and it seemed like a good idea to use the default
charset as default. The most interesting bit is at the bottom.)
Regards,
--
Kristoffer.
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev