Tuesday, June 24, 2003 06:33 AM
You can - before writing anything else - set the content type, which magically switches to the correct Writer.
Note, that out there in the HTML world "UTF-8" is used, and java prefers the canonical form "UTF8" (though often accepts "UTF-8");
String encoding = "UTF-8";
String mimeType = getRequestMimeType(request.getRequestURI());
response.setContentType(mimeType + ";charset=" + encoding);