On Wed, 18 Aug 2004, Kevin Chen wrote:
> I'm trying to send emails to ezweb phones. The encoding I'm using
> is ISO-2022-JP, I set encoding for message body, subject and
> from address. Content type is set as "Content-Type: text/plain;
> charset=ISO-2022-JP". For one ezweb phone, AU/Ezweb C413S, all three
> fields show up in Japanese correctly. But for A3012CA, the From and
> Subject fields cannot display Japanese while the message body displays
> the Japanese message fine.
The Content-type header line is for the body only; it does not apply to
any of the headers. For the headers, you have to use MIME header encoding.
So instead of this in ISO-2022-JP
Subject: カートより
you would need this:
Subject: =?ISO-2022-JP?B?GyRCJSshPCVIJGgkahsoQg==?=
It's encoded as follows:
"=?" + charset-name + "?" + encoding + "?" + data + "?="
where the encoding is "B" for base-64 data and "Q" for quoted-printable
data.
See the MIME RFCs for full details.
Many languages have libraries that will put together this stuff for you
(e.g., JavaMail), but if it's along the lines of the simple example
above, it's easy enough to do yourself so long as you have a base-64
conversion function.
cjs
--
Curt Sampson <cjs_at_cynic.net> +81 90 7737 2974 http://www.NetBSD.org
Don't you know, in this new Dark Age, we're all light. --XTC
Received on Thu Aug 19 05:10:14 2004