hi,

Michiel Meeuwissen wrote:

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..

I did search for a nice method in the (Http)URLConnection, but you only have getContentType() and guessContentTypeFromStream() and you have to parse the results of those. I thought getContent() should do the trick but it returns an InputStream (no Reader) so you will still have to set the encoding yourself.


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

I thought about that, but that's not what you really want.


I think the Jakarta HttpClient Kees suggested might be the most robust solution, but that will make the email application dependent on another library, I don't know if that's a good thing. I'll try to make a really simple content-type parser first.

Simon



Reply via email to