M
Marius Waldal
I have a servlet receiving http-connections from different sources. Some of
these use UTF-8 charset and some use ISO-8859-1 (and I can't influence
this). How can I handle this in the servlet?
I specify the charset based on a configuration, like this:
isr = new InputStreamReader( req.getInputStream(), bbEConfig.strCharSet );
But this only works if the config charset equals the connecting server's
charset, of course.
I've tried using the getCharacterEncoding method in the ServletRequest
class, but is this always set? Or is it only set if the connecting
server/application has explicitly set it?
In summary: how do I dynamically determine which charset to use?
Marius
these use UTF-8 charset and some use ISO-8859-1 (and I can't influence
this). How can I handle this in the servlet?
I specify the charset based on a configuration, like this:
isr = new InputStreamReader( req.getInputStream(), bbEConfig.strCharSet );
But this only works if the config charset equals the connecting server's
charset, of course.
I've tried using the getCharacterEncoding method in the ServletRequest
class, but is this always set? Or is it only set if the connecting
server/application has explicitly set it?
In summary: how do I dynamically determine which charset to use?
Marius