Encoding problems

Hello,

I have a simple HTML form to enter some data. Subject is selected from a
select box, and the ticket body is entered as a textarea.

Both of them contain Japanese characters, and the HTML page displayed in
shift-JIS encoding.

After the page gets submitted, an email is being sent like this:

my $entity = MIME::Entity->build(

                              From => .,

                              To => .,

                              Subject => $cgiInput->param("subject"),

                              Type => "text/plain",

                              Charset => "shift-JIS",

                              Data => $cgiInput->param("TicketBody")

                            );

open (MAIL, “|/usr/sbin/sendmail -oi -t”) || return(0);

print MAIL $entity->as_string;

close(MAIL);

The problem is when I look at the ticket in RT, the encoding of the subject
is correct, but the ticket body is screwed up. It’s not shift-jis, and it’s
not in Unicode. I don’t even know what encoding it’s displayed in. It just
looks as a garbage.

My RT_Siteconfig file has this:

@EmailInputEncodings = qw(shift-JIS utf-8 iso-8859-1 us-ascii);

Set($EmailOutputEncoding , ‘shift-jis’);

Can anybody give me a qlue what I’m doing wrong?

I use RT 3.0.9

Thanks,

Dimitry