[Building Sakai] junk in email messages

Charles Hedrick hedrick at rutgers.edu
Wed Feb 1 07:58:39 PST 2012


I have a fix for this. See KNL-876. 

On Jan 31, 2012, at 4:21 PM, Charles Hedrick wrote:

> We had a complain that announcements containing special characters, e.g.  , show up with garbage characters in the plaintext version.
> 
> Looking at it, &nbsp turns into the correct NS character. However MyMessage in BasicEmailService checks to see whether all the characters can be handled with ISO_8859_1. They can, because it has NS. We then call 
> 
>                                                    bodyPart.setContent(partText.toString(), mimeType);
> 
> using a Mime type of text/plain; charset=iso-8859-1. Unfortunately it appears that the Java mail mechanism doesn't actually use the charset here (and even using setText didn't help). It outputs UTF-8. However since the header claims ISO-8859-1, the mail program displays it incorrectly.
> 
> In theory it makes sense to use 8859 rather than UTF_8 where possible. But the Java mail code seems almost intentionally designed to make it impossible to get this right. I get buried in layers of objects with ill-defined properties. Does anyone know the BasicEmailService well enough to see what's going on?
> 
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



More information about the sakai-dev mailing list