Simon Groenewolt <[EMAIL PROTECTED]> wrote:
> The processing of these fields is done in 
> org.mmbase.applications.email.EmailHandler it checks the content of the 
> "body" field and if it contains a url (http://...) it will get the 
> contents of that url to use as body using:
> 
> URL includeURL = new URL(absoluteUrl+prefix+params);
> HttpURLConnection connection =
> (HttpURLConnection) includeURL.openConnection();
> BufferedReader in =
> new BufferedReader(new InputStreamReader (connection.getInputStream()));
> 
> This means that an InputStreamReader is created using the default/system 
> encoding (probably ISO-8859-1), which is probably not wat you want since 
> you want to use the encoding that is actually being used for the page 
> you are getting. (utf-8 in my case)
> 
> Right now I don't see an easy way to determine te get the encoding of 
> the page you're getting, does anyone know a solution for this? The only 
> way I see right now is parsing the Content-Type header.

I think parsing the Content-Type header would be the only right way to do
it, becaue that is how HTTP works. I would perhaps expect the 'HTML'
connection specialization to knwo how to do that for you, but check apidoc..

The other option would of course be to make it configurable, and suppose all
pages encoded in the same way.


 Michiel

-- 
Michiel Meeuwissen       |
Mediapark C101 Hilversum | 
+31 (0)35 6772979        |  I hate Internet
nl_NL eo_XX en_US        |
mihxil'                  |
 [] ()                   |

Reply via email to