Johannes,

The charset setting is inserted by the MUA preparing the message, not by James (the 
MTA). If your MUA is a java application using javamail, I noticed that there has been 
a change in javamail 1.3.1 compared to a previous release exactly in this area: if 
your text message has special characters (as accented letters etc), and the 
application does not explicitely set a charset (the one to use is 
charset="iso-8859-1"), then the new javamail sets it by default to Cp1252 and you may, 
as I did, encounter exactly the problems you mentioned.

The problem arose when I upgraded the javamail release.

I was using:

        MimeBodyPart mbp = new MimeBodyPart();
        StringBuffer sb = new StringBuffer();
        ...
        if (isHTML != 0) {
            mbp.setDataHandler(new DataHandler(sb.toString(), "text/html"));           
 
        } else {
            mbp.setText(sb.toString());
        }

and changed to:

        MimeBodyPart mbp = new MimeBodyPart();
        StringBuffer sb = new StringBuffer();
        ...
        if (isHTML != 0) {
            mbp.setDataHandler(new DataHandler(sb.toString(), "text/html; 
charset=ISO-8859-1"));            
        } else {
            mbp.setText(sb.toString(), "ISO-8859-1");
        }

Setting "-Dmail.mime.charset=ISO-8859-1" and "-Dfile.encoding=ISO-8859-1" as told in 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg05393.html did solve the problem in 
one Windows machine where my MUA application was running (Windows 2k server Italian?), 
but non in another one (Windows 2k US) - I don't remember exactly the differences - so 
I implemented the code fix shown above, and the problem was solved.

Notice that James was not involved at all.

Hope it helps,

Vincenzo

> -----Original Message-----
> From: Robert J Taylor [mailto:[EMAIL PROTECTED]
> Sent: giovedi 22 gennaio 2004 0.01
> To: James Users List
> Subject: Re: James + Exchange Server 5.5
> 
> 
> Johannes Correa wrote:
> 
> > //Message sent by Exchange
> > This message uses a character set that is not supported by the Internet
> > Service.  To view the original message content,  open the attached message.
> > If the text doesn't display correctly, save the attachment to disk, and then
> > open it using a viewer that can display the original character set.
> > <<message.txt>>
> > 
> > 
> > Reviewing the messages from past year and this year we found a little
> > difference between them: the initial header show "Content-Type: text/html;
> > charset="iso-8859-1"" instead of "Content-Type: text/html; charset=Cp1252"
> > of current messages.
> > 
> > 
> > Does anybody have some idea?
> > 
> 
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg05393.html
> 
> This should answer your question!
> 
> Robert Taylor
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to