Mailing List Archive

Support open source code!


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

Re: tlug: =?iso-2022-jp?B?GyRCRnxLXDhsGyhC?= e-mail header definitions



On Sun, 7 Dec 1997, Craig Oda wrote:

> Maybe, Pine-J has automatic conversion of Subject line encoding?
> 
> Is it readable?

Yes, in Pine-J 3.96, but not pine 3.96 (both in kterm).

Plain old pine does decode the base64 encoding (in the From:
and Subject: lines at least), but then it ironically seems to
"protect" us from control chars (like ESC) on its index screen,
which defeats the Japanese encoding.  (I see the 2 chars ^[
rather than the real ESC char.)

> I was wondering if anyone knew what the proper
> syntax was for Japanese "Subject:" fields in the header
> of an e-mail message.

>From Ken Lunde's CJK.INF.2.1, regarding MIME:

------------- start quote -------------

        Base64 encoding is most commonly used for encoding non-ASCII
text that appears in e-mail headers. Of all the portions of an e-mail
message, its header gets manipulated the most during transmission, and
Base64 encoding offers a safe way to further encode non-ASCII text so
that it is not altered by mail-routing software. This is where Base64
encoding can cause confusion. For example, what goes through your mind
when you see the following chunk o' text?

  From: lunde@example.com (=?ISO-2022-JP?B?vq7O07f1?=)

Many folks think that they are seeing ISO-2022-JP encoding. Not
true. The "ISO-2022-JP" portion is just a flag that indicates the
original encoding before Base64 encoding was applied. The actual
Base64-encoded portion is enclosed between question marks (?) as
follows:

  From: lunde@example.com (=?ISO-2022-JP?B?vq7O07f1?=)
                                        >^^^^^^^^<
The whole string enclosed in parentheses has several components, and
the following explains their purpose and relationships (using the
above string as an example):

  Component      Explanation
  ^^^^^^^^^      ^^^^^^^^^^^
  =?             Signals start of encoded string
  ISO-2022-JP    Charset name ("ISO-2022-JP" is for Japanese)
  ?              Delimiter
  B              Encoding ("B" is for Base64)
  ?              Delimiter
  vq7O07f1       Example string of type "charset" encoded by "encoding"
  ?=             Signals end of encoded string

        One typically does not need to worry about encoding text as
Base64 (MIME-compliant mailing software usually performs this task for
you). The problem is usually trying to decode Base64-encoded text. A
Base64 decoder is available in Perl at the following URL:

  ftp://ftp.ora.com/pub/examples/nutshell/ujip/perl/b64decode.pl

Note that this program takes "raw" Base64 data as input. Any non-
Base64 stuff must be stripped. I usually run this from within Mule
("C-u M-| b64decode.pl") after defining a region around the Base64-
encoded material. I hope to replace this program soon with one that
automatically recognizes the Base64-encoded portions.
        Most MIME-compliant e-mail software can decode Base64-encoded
text.

--------------- end quote --------------

BTW, wasn't somebody looking for such a base64 decoder for their MH?

--
J. David Beutel       "You're inhabited by the society you live in through
11011011 jdb@example.com  your use of language." McCorduck on Turkle on Lacan

---------------------------------------------------------------
TLUG Meeting Dec. 13, 12:30 at Tokyo station Yaesu Chuo ticket gate
13:30 Starbuck's coffee.  13:45 HSBC | info: joem@example.com
At least 3 functional Sparc IPC machines will be raffled out
---------------------------------------------------------------
a word from the sponsor:
TWICS - Japan's First Public-Access Internet System
www.twics.com  info@example.com  Tel:03-3351-5977  Fax:03-3353-6096



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links