Dear all, For UTF-8 pdf generation, you have to patch the following class : com.xpn.xwiki.pdf.impl.PdfExportImpl (http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/xwiki/xwiki/trunk/src/mai...) by replacing the ligne : tidy.setCharEncoding(Configuration.LATIN1); with tidy.setCharEncoding(Configuration.UTF8); It works with French characters but not completly with Chinese or Vietnamese. Regards -- Xavier MOGHRABI - Consortium ObjectWeb Jabber: [email protected] - Phone: +33 4 76 61 52 35 Le vendredi 1 septembre 2006 15:00, Richard Lach a écrit :
On Thu, Aug 31, 2006 at 10:01:04PM +0200, Ludovic Dubost wrote:
Sorry I didn't look at the exception.. Clearly it seems to be a UTF-8 problem. Maybe Xavier or Stephane have an idea since they are running xwiki on UTF-8
Now I can confirm it. Problem is for sure in xsl transformation and occurs only when using non-latin1 characters.
With brand new xwiki database I can export document containing 'a' or 'ó' (oacute), which have the same codes in LATIN1, LATIN2 and UTF-8. When I enter some other non-LATIN1 characters - export fails with exception
[Fatal Error] :66:27: Invalid byte 2 of 2-byte UTF-8 sequence. 11:43:33,806 WARN http-8080-Processor24 http://localhost:8080/xwiki/bin/pdf/Sandbox/TestTopic1 XWikiAction:execute:185 - Uncaught exception: Error number 12003 in 12: XSL Transformation Failed Wrapped Exception: Invalid byte 2 of 2-byte UTF-8 sequence. com.xpn.xwiki.XWikiException: Error number 12003 in 12: XSL Transformation Failed Wrapped Exception: Invalid byte 2 of 2-byte UTF-8 sequence. at com.xpn.xwiki.pdf.impl.PdfExportImpl.applyXsl(PdfExportImpl.java:176) at com.xpn.xwiki.pdf.impl.PdfExportImpl.convertXHtmlToXMLFO(PdfExportImpl.java :154) [...]
Problem with saving a document containing only single letter 'a' in my previous tests has probably something to do with my database, which I used - it has plenty documents with non-LATIN1 content and probably some charactes not belonging to editable part of xwiki page (maybe some preferences?) was transformed with xslt throwing an exception.
I have xwiki run on eclipse, but I'm not a programmer, so I affraid I won't be able to find much more....
Does anybody have working pdf-export of UTF-8 documents?
Richard.