Hi > > Maybe you should query tomcat-dev list about how (and if you really > > need) to override Jasper's behaviour on inserting "pageEncoding" value > > into Content-Type header. > >
In tomcat-dev list, they say "IT'S SPEC." that's it. I've learned that "If you don't like it, shut up and use your default." I found a workaround. Let the jasper using default encoding, and call encoding conversion method before you pass strings to other methods in your jsp. Hope this helps someone. ------------------------------------------------------------------------- <%@ page language="java" import="java.io.*, com.lowagie.text.*, com.lowagie.text.pdf.*" %> <%@ page contentType="application/pdf"%> <%! //=============encoding conversion============ String getSjis(String str) throws java.io.UnsupportedEncodingException{ String str2=new String(str.getBytes("ISO-8859-1"),"SJIS"); return str2; } %> <% Document document = new Document(); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); PdfWriter pdfwriter = PdfWriter.getInstance( document, buffer ); document.open(); BaseFont bf = BaseFont.createFont("HeiseiKakuGo-W5","UniJIS-UCS2-H",false); PdfContentByte pcb = pdfwriter.getDirectContent(); pcb.beginText(); pcb.setTextMatrix(50,800); pcb.setFontAndSize(bf,12); pcb.setLeading(15); pcb.showText("English"); //==================== use encoding conversion ============= pcb.showText(getSjis("=====JAPANESE STRING HERE=====")); pcb.endText(); document.close(); response.setContentLength(buffer.size()); ServletOutputStream output = response.getOutputStream(); buffer.writeTo(output); output.flush(); %> ----------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]