Operating System - HP-UX
1753717 Members
4405 Online
108799 Solutions
New Discussion юеВ

Re: sendmail japanese character

 
malay boy
Trusted Contributor

sendmail japanese character

Hi,
Appreciate if anybody can show me direction on how to troubleshoot this issue :

I have a HPUX 11.23 which have a Oracle 10G Release 2 database. In the database we already set the language as UTF8.

We have a user in Japan which insert the japanese character to the db.

When we do a normal select statement from database we could see the japanese character ( i think )

Problem :
But we have a sendmail script which read the database and sent email to customer. The problem is the email is rubbish character.

Any idea where can i start to troubleshoot .. I'm pretty confuse now.

regards
mB
There are three person in my team-Me ,myself and I.
3 REPLIES 3
Matti_Kurkela
Honored Contributor

Re: sendmail japanese character

The script that sends the email should either add the proper MIME headers to identify the character set, or the script should use some MUA that can handle this automatically instead of accessing sendmail directly.

The correct MIME headers would seem to be:
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8

There are several ways to encode Japanese characters; Unicode UTF8 is only one of them. When the Japanese user receives the email, his/her mail program might try to display the characters using some older encoding if the email does not specify the message is using UTF8. This of course produces rubbish characters (mojibake).

According to Wikipedia, the Japanese mail programs would be likely to assume JIS encoding if the encoding is not explicitly specified:
http://en.wikipedia.org/wiki/Japanese_language_and_computers

Could you show us how your sendmail script works? If it invokes sendmail directly, it might be easy to make it add those header lines.

MK
MK
malay boy
Trusted Contributor

Re: sendmail japanese character

hi MK,
Here are part of the script :

------------------------------------------
echo "Content-Type: text/plain; charset=UTF-8"
# end > msg
cat content.msg >> msg

sendmail malayboy@malayboy.com < msg

-----------------------------------------

content.msg content are pull from the database. In db the character are correctly in japanese.


We have try to put characterset on top of the email but still comeout rubbish.

thanks tho , MK .. anymore cool idea ??
There are three person in my team-Me ,myself and I.
Matti_Kurkela
Honored Contributor

Re: sendmail japanese character

You must insert one blank line to separate the headers from the message body.

The MIME-Version header is required: otherwise the Content-Type may be ignored.

For example:

echo "MIME-Version: 1.0" > msg
echo "Content-Type: text/plain; charset=UTF-8" >> msg
echo "" >> msg
cat content.msg >> msg
sendmail malayboy@malayboy.com < msg

MK
MK