Can I set the default encoding in web.xml?

Hi

I have a query regarding the default encoding. In my application, I do the string conversion from ISO8859_1 to UTF8, assuming that the default encoding is ISO8859_1.

s = new String(s.getBytes("ISO8859_1"), "utf8");

However this results in erronious conversions. When I change the ISO8859_1 encoding to Cp1253, I get the correct result.

If I cannopt change the encoding in the above piece of code, is there any other way by which I can set the default encoding to ISO8859_1, so that the above line returns the correct value? Can I change the settings in web.xml or somethin?

[609 byte] By [samidakua] at [2007-11-26 17:38:59]
# 1
There's a nice article on this subject here: http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/in the article they've mentioned web.xml but I'm not sure if it applies to your case. Read the whole article to see if you can use some techniques used in
appy77a at 2007-7-9 0:07:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi ,Thanks for the reply. But I still have the problem. I cannot use request.setCharacterEncoding. For HttpServletRequest there is no such method. Is it somehow possible to set the encoding without using request.setCharacterEncoding?
samidakua at 2007-7-9 0:07:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...