oops, looks like I missed one statement. Will post new diff soon..
New diff... I'll ask Daniel to include it. How about including it in the stable branch, what are the requirements for including stuff in the stable branch? (I think this patch is more or less a bugfix)
Simon
cvs -z9 -q diff EmailHandler.java (in directory C:\Documents and
Settings\simon\CVSTREE\mmbase\applications\email\src\org\mmbase\applications\email\)
Index: EmailHandler.java
===================================================================
RCS file:
/usr/local/cvs/applications/email/src/org/mmbase/applications/email/EmailHandler.java,v
retrieving revision 1.11
diff -r1.11 EmailHandler.java
194c194,223
< BufferedReader in = new BufferedReader(new InputStreamReader
(connection.getInputStream()));
---
> String contentType = connection.getContentType();
>
> // Default encoding for http transport is iso-8859-1
> String encoding = "ISO-8859-1";
>
> // If a Content-Type header is present: get the encoding from there
> if (contentType != null) {
>
> StringTokenizer tokenizer = new StringTokenizer(contentType, "; ");
> while (tokenizer.hasMoreTokens()) {
> String value = tokenizer.nextToken();
> if (value.startsWith("charset=")) {
> // charset overrides the defaults for the mimetypes
> encoding = value.substring(8);
> }
> if (value.equals("text/xml")) {
> // default encoding for text/xml
> encoding = "utf-8";
> }
> if (value.equals("text/html")) {
> // default encoding for text/html
> encoding = "ISO-8859-1";
> }
> if (value.equals("text/plain")) {
> // default encoding for text/plain
> encoding = "ISO-8859-1";
> }
> }
> }
> BufferedReader in = new BufferedReader(new InputStreamReader
> (connection.getInputStream(), encoding));
