Problème when Generating PDF with vietnamese characters
Hello I've got a xwiki installation that contains vietnamese characters encoded in UTF-8. I can see the characters without problem in my browser. However it seems I canno't generate PDF when there are vietnamese characters. I've got the below exception in Tomcat. You can test it by your self on http://www.cosgov.org Best regards -- Xavier MOGHRABI - Consortium ObjectWeb Email: xavier.moghrabi at objectweb.org Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau -- line 5 column 1 - Warning: <html> has XML attribute "xml:lang" line 49 column 316 - Warning: <table> lacks "summary" attribute line 54 column 1 - Warning: replacing illegal character code 135 10:07:06,335 WARN TP-Processor17 http://www.cosgov.org/xwiki/bin/pdf/Main/WebHome ViewEditAction:execute:239 - Uncaught exception: Error number 12003 in 12: XSL Transformation Failed Wrapped Exception: Invalid byte 3 of 3-byte UTF-8 sequence. com.xpn.xwiki.XWikiException: Error number 12003 in 12: XSL Transformation Failed Wrapped Exception: Invalid byte 3 of 3-byte UTF-8 sequence. at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyXsl(PdfExportImpl.java:169) at com.xpn.xwiki.pdf.impl.PdfExportImpl.convertXHtmlToXMLFO(PdfExportImpl.java:147) at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportXHtml(PdfExportImpl.java:79) at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportHtml(PdfExportImpl.java:108) at com.xpn.xwiki.pdf.impl.PdfExportImpl.export(PdfExportImpl.java:122) at com.xpn.xwiki.pdf.impl.PdfExportImpl.exportToPDF(PdfExportImpl.java:112) at com.xpn.xwiki.XWikiService.renderPDF(XWikiService.java:892) at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:168) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Wrapped Exception: java.io.UTFDataFormatException: Invalid byte 3 of 3-byte UTF-8 sequence. at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source) at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) ...
Hi Xavier, You should report this in a bug: http://jira.xwiki.org Apparently the problem happens when applying the first XSL Stylesheets to convert XHTML to XMLFO. What's not clear to me is why it says "invalid UTF" when it's actually UTF.. I'm not sure where in the code there is some different behavior to have depending on the encoding.. This will need some research and debugging. Ludovic Xavier MOGHRABI a écrit :
Hello
I've got a xwiki installation that contains vietnamese characters encoded in UTF-8.
I can see the characters without problem in my browser.
However it seems I canno't generate PDF when there are vietnamese characters. I've got the below exception in Tomcat. You can test it by your self on http://www.cosgov.org
Best regards
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
Hi Ludovic, The vietnamese characters come from ApplicationResource file. I joined in attachment the vietnamese file that I used. As you can see vietnamese characters are encoded in UTF-8. Regards -- Xavier MOGHRABI - Consortium ObjectWeb Email: xavier.moghrabi at objectweb.org Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau Le Jeudi 16 Juin 2005 10:26, Ludovic Dubost a écrit :
Hi Xavier,
You should report this in a bug: http://jira.xwiki.org Apparently the problem happens when applying the first XSL Stylesheets to convert XHTML to XMLFO. What's not clear to me is why it says "invalid UTF" when it's actually UTF.. I'm not sure where in the code there is some different behavior to have depending on the encoding.. This will need some research and debugging.
Ludovic
Xavier MOGHRABI a écrit :
Hello
I've got a xwiki installation that contains vietnamese characters encoded in UTF-8.
I can see the characters without problem in my browser.
However it seems I canno't generate PDF when there are vietnamese characters. I've got the below exception in Tomcat. You can test it by your self on http://www.cosgov.org
Best regards
participants (2)
-
Ludovic Dubost -
Xavier MOGHRABI