dcsimg
Header parameter folding issue
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stephen_Smith
Posted On:   Thursday, November 28, 2002 01:17 PM

I'm using the MimeUtility.encodeWord() method in JavaMail 1.3 to RFC2047 encode a long filename with extended characters. (Let's not get into a discussion about RFC2231 encoding for parameters, Outlook doesn't understand RFC2231 parameters and creates RFC2047 so that's that.) encodeWord returns a result of (line breaking intended): =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=  =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=  =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=  =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=  =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=  =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqc   More>>

I'm using the MimeUtility.encodeWord() method in JavaMail 1.3 to RFC2047 encode a long filename with extended characters. (Let's not get into a discussion about RFC2231 encoding for parameters, Outlook doesn't understand RFC2231 parameters and creates RFC2047 so that's that.)



encodeWord returns a result of (line breaking intended):


			
=?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=



This is all well and good as Outlook wants the filename parameter to look exactly like this. Now, using the MimeBodyPart.setFilename() method (//OR// setting a header/parameter using the setHeader("Content-Disposition", (ContentDisposition.toString())) results in:


			
filename="=?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 >=?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?=

 =?UTF-8?B?w6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6nDqcOpw6k=?="



Which is NOT well and good as no client likes the backslashes as a line continuation character. Is there a way to avoid the '\' or should I create the headers directory without using the ContentDisposition class?    <<Less
About | Sitemap | Contact