MIME decoding source

0 views
Skip to first unread message

Chae, Chang Hwan

unread,
Jun 20, 1997, 3:00:00 AM6/20/97
to

Hi,

I am making a e-mail client...
By the way, I"m in trouble...
I need lots of infomation about MIME encoding/decoding... especially source
code(in Java or c).
Help me, please.

--
hoh...@handy.co.kr
Ho


Jim Dompier

unread,
Jun 25, 1997, 3:00:00 AM6/25/97
to

Chae, Chang Hwan wrote...

Search the internet for MIME or UUE and you will find C source code
for this. I was looking for VB source code about 1 year ago, and came
across plenty of C source for all types of encoding.

--
Jim Dompier
IslandSoft
http://www.lava.net/~islesoft

**Please remove the seven from my e-mail address to respond**

Joseph Partridge

unread,
Jul 9, 1997, 3:00:00 AM7/9/97
to Chae, Chang Hwan

This is a multi-part message in MIME format.
--------------E8AE610FD86E3A76491A4278
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

Chae, Chang Hwan wrote:

> Hi,
>
> I am making a e-mail client...
> By the way, I"m in trouble...
> I need lots of infomation about MIME encoding/decoding... especially
> source
> code(in Java or c).
> Help me, please.
>
> --
> hoh...@handy.co.kr
> Ho

Here is some code I wrote to encode\decode base64. I had to figure it
out for myself because I couldn't find anything on the 'net about this.
Weird isn't it?

--
Joseph Partridge jos...@totcon.com
Partridge Software
http://www.partridgesoft.com


--------------E8AE610FD86E3A76491A4278
Content-Type: application/x-unknown-content-type-C/CPP Source Files; name="base64.c"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="base64.c"

<encoded_portion_removed>
ICB9DQoNCiAgICByZXR1cm4gMTsNCn0NCg==
--------------E8AE610FD86E3A76491A4278
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joseph Partridge
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Joseph Partridge
n: Partridge;Joseph
org: Partridge Software
email;internet: jos...@totcon.com
title: Software Developer
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
end: vcard


--------------E8AE610FD86E3A76491A4278--


Igor Metz

unread,
Jul 11, 1997, 3:00:00 AM7/11/97
to

Joseph Partridge wrote:
> Here is some code I wrote to encode\decode base64. I had to figure it
> out for myself because I couldn't find anything on the 'net about this.
> Weird isn't it?

Just look in the right place!
The W3 Consortium Java Web server jigsaw (which come in source) contains
what you need:
package w3c.www.mime ;
(class MimeParser et al.)
package w3c.tools.codec ;
(classes Base64Decoder and Base64Encoder)
--
Dr. Igor Metz <me...@glue.ch>, http://www.glue.ch/~metz
GLUE Software Engineering AG, Zieglerstr. 34, CH-3007 Bern, Switzerland
Phone: (++41) 31 385 30 11 Fax: (++41) 31 385 30 18

Walter van Iterson

unread,
Jul 11, 1997, 3:00:00 AM7/11/97
to

Igor Metz wrote:
>
> Joseph Partridge wrote:
> > Here is some code I wrote to encode\decode base64. I had to figure
> > it out for myself because I couldn't find anything on the 'net
> > about this.
> > Weird isn't it?
>
> Just look in the right place!

In case you wondered : http://www.w3.org

Walter van Iterson
walte...@sni.de

Laird Nelson

unread,
Jul 11, 1997, 3:00:00 AM7/11/97
to

This is a multi-part message in MIME format.
--------------45515BD170BB4B095813F575
Content-Type: multipart/alternative; boundary="------------C983D2172E3692CF3181F6BD"


--------------C983D2172E3692CF3181F6BD


Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Walter van Iterson wrote:

> Igor Metz wrote:
> > Just look in the right place!
> In case you wondered : http://www.w3.org

Warning: rather long news message and rampant but tangential comparisons
to Perl follow; trust me--this is about Java, and is not an advocacy
message, or a flame war in the making. Think of it as a request for
discussion or comments. I'm happy to continue this thread or very
politely shut up and go home. :-)

The million dollar question: Where do you find common free Java stuff?

Were I to post this question, I'd probably get back a whole host of
answers, referring me to a whole host of different URLs with a whole
host of different packages tested with a whole host of different
assumptions and requirements.

I come originally from the Perl camp, which I think has answered this
question well, and, as usual, in its own quirky way. I'm referring to
the CPAN (the Comprehensive Perl Archive Network). For those who don't
know what that is, I'll explain very briefly.

Very briefly, then: the CPAN is a mirrored collection of FTP sites which
host the Perl modules (classes/packages) others have developed and
released into the public domain for no charge. These modules are for
the most part written to address the yawning maw between low level APIs
(i.e. the builtin functions in Perl, or, analogously, the JDK API) and
high level APIs (such as the API to whatever application you happen to
be writing). Modules include everything from MIME packages to
implementations of the libwww reference library to FTP/SMTP/NNTP client
packages to Windows .ini file readers. The site is indexed in a variety
of ways and has some quality guidelines that try to indicate what kind
of software it is that you'll be downloading (alphaware, vaporware,
production quality, etc.). Furthermore, it is somewhat difficult (but
not at all impossible or, really, that hard) to become a developer who
is "registered" (not sure what word to use there) on the site as an
"official" author, a required effort which I personally think is a good
thing. Finally there is a CPAN Perl module itself, which, in a
bootstrappy sort of way, enables you to write Perl applications that
search CPAN for new stuff, updates, or relevant modules (self-updating
classes, for example). If you'd like to poke around to see what it is,
you can go to http://www.perl.com/CPAN/ and take it from there.

The general theory of the CPAN is one that is foundational to Perl: As
real-world programmers, we are lazy and impatient, and we don't want to
reinvent the wheel unless absolutely necessary. I've certainly used it
in every single one of my previous Perl projects (and find that I miss
it sorely with Java--that could be a real need, or just residual culture
shock, or homesickness of a sort).

I submit that we could really use a CJAN with roughly the same operating
principles (I also submit that Gamelan is not this sort of place; see
below). Not one run by a corporation, or by Sun (although that actually
sits fine with me), but by the Java community itself (those of us
willing to write software that handles common middle-level tasks well,
because hey, it's fun).

I see several reasons for this.

1. People on the various comp.lang.java.* groups frequently ask where
they can find such-and-such a package that deals with some
more-or-less common applications (connecting to FTP servers,
decoding MIME mail, pinging a host, etc.), and are sent to various
URLs that refer them to a number of packages which may or may not
be what they're looking for.
2. Some of those repositories don't have any sort of criteria for
admission or quality control.
3. Some software should be proprietary in the world at large, but I
submit that common wheel-reinventing tasks should at least have
free alternatives, and a central, easy-to-use location where they
can be browsed, downloaded, or even, he said, stars appearing in
his eyes, loaded from an RMI server. But back to planet Earth.
4. It would be nice to be able to refer to free Java software from
this CJAN in much the same way that folks refer to things like
design patterns (people do this in Perl-land all the time: "Use LWP
[libwww] for that," "You really should be using FileHandle for
that," etc.).
5. A central repository of reusable components is something that is
valuable in the abstract, let alone the concrete. I think that
CPAN has proven that that sort of thing can be done passably well,
even for a language where OO is an optional part of its syntax.
Strikes me that it should be easy to do for an intrinsically OO
language. Lest I sound completely naive, I know that the promise
of reusability is largely unfulfilled, and I agree that it's hard
to dispense with, say, 364 different Person objects in favor of one
canonical one. However, I think that reuse of, say, MIME
components is not nearly as complicated. Again, have a look at the
CPAN to see what sorts of things have done well as reusable
components.
6. People are always talking about how development time takes a long
time. If you were able to download the "canonical" solution for a
particular mind-numbingly dull task and spend your energy on
getting the domain objects and classes right, development time
would speed up.
7. Corporations often have their own libraries of reusable components,
but that doesn't help the small fry on the outside of the firewall.

Any other ex- or current Perlers who read this group: comments?

Potential problems: The Perl community is exactly that: a community.
The community is of people who are drawn to a language that lets them
express their traits of laziness, impatience and hubris in as horribly
twisted and sadistic a way as possible. :-) Therefore it was probably
only a matter of time before some poor slob, writing the world's
14,502nd MIME decoder, said, "This is ridiculous," and started offering
some free middle-level modules in some kind of minimally structured way.

It strikes me that the Java community (and please; this isn't a flame; I
consider myself one of them) is different: perhaps not as odd?, or
perhaps not as united? or perhaps more like the C++ community where
everyone writes their own Hashtable class, even when presented with the
STL? :-) {ducks} In addition, there is no imposition of the GNU
public license or anything equivalent on a large amount of Java software
as there is with Perl. Couple these "facts" together and perhaps the
Java community is not going to put up something like a CJAN, because
there isn't much demand for one--most people charge money for their
software, even if it's something that solves a non-proprietary task.

These are preliminary thoughts, pro and con. Feel free to respond or
ignore. Have a look at the CPAN and see what you think--comparisons and
criticisms are welcomed.

Cheers,
Laird
--
Laird Nelson
Associate, Perot Systems Corporation, for whom I do not to speak.
mailto:ljne...@unix.amherst.edu Spam guard: wo...@savetrees.com

--------------C983D2172E3692CF3181F6BD
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Walter van Iterson wrote:
<BLOCKQUOTE TYPE=CITE>Igor Metz wrote:
<BR>> Just look in the right place!
<BR>In case you wondered : <A HREF="http://www.w3.org">http://www.w3.org</A></BLOCKQUOTE>
Warning: rather long news message and rampant but tangential comparisons
to Perl follow; trust me--this is about Java, and is not an advocacy message,
or a flame war in the making.&nbsp; Think of it as a request for discussion
or comments.&nbsp; I'm happy to continue this thread or very politely shut
up and go home.&nbsp; :-)

<P>The million dollar question: Where do you find common free Java stuff?

<P>Were I to post this question, I'd probably get back a whole host of
answers, referring me to a whole host of different URLs with a whole host
of different packages tested with a whole host of different assumptions
and requirements.

<P>I come originally from the Perl camp, which I think has answered this
question well, and, as usual, in its own quirky way.&nbsp; I'm referring
to the <A HREF="http://www.perl.com/CPAN/">CPAN </A>(the Comprehensive
Perl Archive Network).&nbsp; For those who don't know what that is, I'll
explain very briefly.

<P>Very briefly, then: the CPAN is a mirrored collection of FTP sites which
host the Perl modules (classes/packages) others have developed and released
into the public domain for no charge.&nbsp; These modules are for the most
part written to address the yawning maw between low level APIs (i.e. the
builtin functions in Perl, or, analogously, the JDK API) and high level
APIs (such as the API to whatever application you happen to be writing).&nbsp;
Modules include everything from MIME packages to implementations of the
libwww reference library to FTP/SMTP/NNTP client packages to Windows .ini
file readers.&nbsp; The site is indexed in a variety of ways and has some
quality guidelines that try to indicate what kind of software it is that
you'll be downloading (alphaware, vaporware, production quality, etc.).&nbsp;
Furthermore, it is somewhat difficult (but not at all impossible or, really,
<I>that</I> hard) to become a developer who is "registered" (not sure what
word to use there) on the site as an "official" author, a required effort
which I personally think is a good thing.&nbsp; Finally there is a CPAN
Perl module itself, which, in a bootstrappy sort of way, enables you to
write Perl applications that search CPAN for new stuff, updates, or relevant
modules (self-updating classes, for example).&nbsp; If you'd like to poke
around to see what it is, you can go to <A HREF="http://www.perl.com/CPAN/">http://www.perl.com/CPAN/</A>
and take it from there.

<P>The general theory of the CPAN is one that is foundational to Perl:
As real-world programmers, we are lazy and impatient, and we don't want
to reinvent the wheel unless absolutely necessary.&nbsp; I've certainly
used it in every single one of my previous Perl projects (and find that
I miss it sorely with Java--that could be a real need, or just residual
culture shock, or homesickness of a sort).

<P>I submit that we could really use a CJAN with roughly the same operating
principles (I also submit that Gamelan is not this sort of place; see below).&nbsp;
Not one run by a corporation, or by Sun (although that actually sits fine
with me), but by the Java community itself (those of us willing to write
software that handles common middle-level tasks well, because hey, it's
fun).

<P>I see several reasons for this.
<OL>
<LI>
People on the various <TT>comp.lang.java.*</TT> groups frequently ask where
they can find such-and-such a package that deals with some more-or-less
common applications (connecting to FTP servers, decoding MIME mail, pinging
a host, etc.), and are sent to various URLs that refer them to a number
of packages which may or may not be what they're looking for.</LI>

<LI>
Some of those repositories don't have any sort of criteria for admission
or quality control.</LI>

<LI>
Some software should be proprietary in the world at large, but I submit
that common wheel-reinventing tasks should at least have free alternatives,
and a central, easy-to-use location where they can be browsed, downloaded,
or even, he said, stars appearing in his eyes, loaded from an RMI server.&nbsp;
But back to planet Earth.</LI>

<LI>
It would be nice to be able to refer to free Java software from this CJAN
in much the same way that folks refer to things like design patterns (people
do this in Perl-land all the time: "Use LWP [libwww] for that," "You really
should be using FileHandle for that," etc.).</LI>

<LI>
A central repository of reusable components is something that is valuable
in the abstract, let alone the concrete.&nbsp; I think that CPAN has proven
that that sort of thing can be done passably well, even for a language
where OO is an optional part of its syntax.&nbsp; Strikes me that it should
be easy to do for an <I>intrinsically</I> OO language.&nbsp; Lest I sound
completely naive, I know that the promise of reusability is largely unfulfilled,
and I agree that it's hard to dispense with, say, 364 different Person
objects in favor of one canonical one.&nbsp; However, I think that reuse
of, say, MIME components is not nearly as complicated.&nbsp; Again, have
a look at the CPAN to see what sorts of things have done well as reusable
components.</LI>

<LI>
People are always talking about how development time takes a long time.&nbsp;
If you were able to download the "canonical" solution for a particular
mind-numbingly dull task and spend your energy on getting the domain objects
and classes right, development time would speed up.</LI>

<LI>
Corporations often have their own libraries of reusable components, but
that doesn't help the small fry on the outside of the firewall.</LI>
</OL>
Any other ex- or current Perlers who read this group: comments?

<P>Potential problems: The Perl community is exactly that: a community.&nbsp;
The community is of people who are drawn to a language that lets them express
their traits of laziness, impatience and hubris in as horribly twisted
and sadistic a way as possible.&nbsp; :-)&nbsp; Therefore it was probably
only a matter of time before some poor slob, writing the world's 14,502nd
MIME decoder, said, "This is ridiculous," and started offering some free
middle-level modules in some kind of minimally structured way.

<P>It strikes me that the Java community (and please; this isn't a flame;
I consider myself one of them) is different: perhaps not as odd?, or perhaps
not as united? or perhaps more like the C++ community where everyone writes
their own Hashtable class, even when presented with the STL?&nbsp; :-)&nbsp;
{ducks}&nbsp; In addition, there is no imposition of the GNU public license
or anything equivalent on a large amount of Java software as there is with
Perl.&nbsp; Couple these "facts" together and perhaps the Java community
is not going to put up something like a CJAN, because there isn't much
demand for one--most people charge money for their software, even if it's
something that solves a non-proprietary task.

<P>These are preliminary thoughts, pro and con.&nbsp; Feel free to respond
or ignore.&nbsp; Have a look at the <A HREF="http://www.perl.com/CPAN/">CPAN
</A>and see what you think--comparisons and criticisms are welcomed.

<P>Cheers,
<BR>Laird
<BR><TT>--</TT>
<BR><TT>Laird Nelson</TT>
<BR><TT>Associate, Perot Systems Corporation, for whom I do not to speak.</TT>
<BR><TT><A HREF="mailto:ljne...@unix.amherst.edu">mailto:ljne...@unix.amherst.edu</A>&nbsp;&nbsp; Spam guard: wo...@savetrees.com</TT></HTML>

--------------C983D2172E3692CF3181F6BD--

--------------45515BD170BB4B095813F575


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit

Content-Description: Card for Laird Nelson
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Laird Nelson
n: Nelson;Laird
org: Perot Systems Corporation
adr: 19 Willow Ave;;Apt 1;Salem;MA;01970;USA
email;internet: ljne...@unix.amherst.edu
title: Associate (Software Engineer)
tel;work: (617) 303-5059
tel;fax: (617) 303-5293
tel;home: (508) 741-3126
note: Information in this card is for personal use only;
=0A=
please do not abuse it.
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
end: vcard


--------------45515BD170BB4B095813F575--


C Matthew Curtin

unread,
Jul 12, 1997, 3:00:00 AM7/12/97
to Laird Nelson

Laird Nelson <ljne...@unix.amherst.edu> writes:

> I submit that we could really use a CJAN with roughly the same operating
> principles (I also submit that Gamelan is not this sort of place; see
> below). Not one run by a corporation, or by Sun (although that actually
> sits fine with me), but by the Java community itself (those of us
> willing to write software that handles common middle-level tasks well,
> because hey, it's fun).

I've been poking around with Perl since late 1991, actively hacking
with it since 1993.

Yes, having a community-run CJAN would be cool.

However, there seem to be a number of very significant differences
between the Perl and Java communities, such that it might not be
possible to make a CJAN that's as complete as CPAN.

The Perl community is about freedom. Perl is free. Perl modules are
free. The cost: free. The source code is free. You can even choose
which license you want to use: GPL or the Artistic License. With
Perl, you can do anything you want, however you want. It's the
ultimate language for hacking: it allows you to apply the appropriate
amount of ingenuity for any job. You can slap together a two-liner
that crawls through a directory of files, reads them in, and spews
them in another format. Or you can create a huge, complex piece of
software and implement it elegantly, with OO components, blessing and
invoking methods, etc. You can optimize any Perl program for speed,
readability, or anything else that you think is important (or fun).
Any Perl program that gets the job done before your boss fires you is
correct.

Java is about software engineering. The target market of Java is that
of commercial software developers. People who make their livings from
building programs that other people use. These people typically don't
want to share the way that their Perl counterparts do: it would mean a
potential loss of income. (As an example, after the release of the
Java Beta API, one of the first classes that I saw available was a
bytecode obfuscator. There are people in the Java world who don't
even want their code to be reverse-engineerable.)

Many who are making tools for Java development are making _commercial_
tools for Java development.

This isn't to say that all Java programs are commercial, or that there
are no commercial Perl programs. I'm simply observing what seems to
be the tendency of each.

There is a very-different-from-CPAN directory for Java that's quite
comprehensive: http://www.gamelan.com/ There, Java class libraries
are only a part of what's available. What could CJAN have over a
directory like Gamelan?

If we can come up with a list of things that Gamelan seems to be
missing, I suspect our best bet would be to see if they'd be willing
to incorporate solutions to those items, and if not, then going
forward with a CJAN...

--
Matt Curtin Chief Scientist Megasoft Online cmcu...@research.megasoft.com
http://www.research.megasoft.com/people/cmcurtin/ I speak only for myself
Pull AGIS.NET's plug! DES has fallen! http://www.frii.com/~rcv/deschall.htm

Reply all
Reply to author
Forward
0 new messages