james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioan Eugen Stan <stan.ieu...@gmail.com>
Subject Re: Automatic Decoding of field contents
Date Wed, 30 May 2012 21:44:25 GMT
Hi Gunther,

Not sure of I could help but please have a look at chapter 5:
Content-Type Header Field http://www.ietf.org/rfc/rfc2045.txt .

I reproduced the relevant part:
 The Content-Type header field specifies the nature of the data in the
   body of an entity by giving media type and subtype identifiers, and
   by providing auxiliary information that may be required for certain
   media types.  After the media type and subtype names, the remainder
   of the header field is simply a set of parameters, specified in an
   attribute=value notation.  The ordering of parameters is not

You'll have to see what are the parameters for application/zip and how
they should be encoded. It seems to me that they are indexed file
names with some optional encoding in between. Furthermore I don't
think that MimeStreamParser.setContentDecoding(true) refers to how
mime4j decodes field parameters.

Hope this helps,

2012/5/31 Günther Schmidt <guenther.schmidt@kmmd.de>:
> Hi everyone,
> sorry for the confusion, the mimeparser set to do decoding *does* also
> decode content fields. It just has trouble recognizing some more exotic ones
> correctly, like this one:
> Content-Type: application/zip;
> name*0*=iso-8859-15''Redcom%20Erl%F6santeilsplit;
>  name*1*=ter.zip
> Anybody here know a neat trick to get around this hick up?
> Günther
> Am 30.05.12 00:37, schrieb Günther Schmidt:
>> Hi everyone,
>> I've figured out how to get the parser to automatically decode input
>> streams, ie make mime4j return Base64InputStream or
>> QuotedPrintableInputStream, by setting
>> MimeStreamParser.setContentDecoding(true).
>> However this does not seem to affect the contents of any of the headers
>> fields. Their bodies are still quotedprintable encoded, even when parsed, ie
>> turned into a ParsedField, which causes some errors in my code.
>> I haven't found the switch for automatically decoding the field contents
>> as well. What do I have to do?
>> Günther

Ioan Eugen Stan
http://ieugen.blogspot.com/  *** http://bucharest-jug.github.com/ ***

View raw message