The levers and dials of character set encoding can be overwhelming, just looking at the matrix supported by J2SE 1.4.2 gives me vertigo. Java's encoding conversion support is simple enough, if not garrulous:
String iso88591String = request.getParameter("q"); String utf8String = new String(iso88591String.getBytes("UTF-8"));But what do you do if you don't know what encoding you're dealing with to begin with? It looks as though there are a couple of ways to do it:
String q_unknown_japanese = request.getParameter(q); String q_unicode = new String(q_unknown.getBytes("ISO8859_1"),"JISAutoDetect");