Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Japanese in Perl on Linux




On Wed, 12 May 2004 11:14:17 +0900
Blomberg David <dblomber@example.com> wrote:

> I am using perl to send an email it works except that Japanese text come
> out as question marks.
> 
> could any perl monger out there let me in on how I am doing this wrong?
> ------first version----------------------------------
> print MAIL "荳肴ュ」繝代せ繝ッ繝シ繝画ュ蝣ア";
> 
> (first version output is just question marks)
> ------Second version----------------------------------
> $temp = MIME::Base64::encode("荳肴ュ」繝代せ繝ッ繝シ繝画ュ蝣ア");
> chomp($temp);
> print MAIL "=?ISO-2022-JP?B?$temp?=\n";
> 
> (this one I get the string
> =?ISO-2022-JP?B?Pz8/Pz8/Pz8/?=
> mime encoded Japanese text as best I can tell)
> -----------------------------------------------------


You don't need to base 64 encode Japanese if it is JIS (ISO2022), in
fact you shouldn't. JIS is already 7 bit ascii. Just make sure it is
encoded as JIS. If it isn't encoded in JIS, eg SJIS, using something
like mkf to change it to JIS.


Brett


-- 
Brett Robson 
Systems Administrator
GOL 
http://www.gol.com
Phone: 03-3239-6856    International: +81-3-3239-6856

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links