Index: src/test/java/com/xpn/xwiki/test/PDFExportTest.java
===================================================================
--- src/test/java/com/xpn/xwiki/test/PDFExportTest.java	(Revision 977)
+++ src/test/java/com/xpn/xwiki/test/PDFExportTest.java	(Arbeitskopie)
@@ -44,8 +44,8 @@
         return "</body>\n</html>\n";
     }
 
-    public void testXHTMLConversion() {
-        PdfExportImpl pdfexport = new PdfExportImpl();
+    public void testXHTMLConversion() {
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         pdfexport.setXhtmlxsl("xhtml2fo.xsl");
         String html = getHeader() + "<p>Hello" + getFooter();
         String xhtml = new String(pdfexport.convertToStrictXHtml(html.getBytes()));
@@ -53,7 +53,7 @@
     }
 
     public void testPDFConversion() throws XWikiException {
-        PdfExportImpl pdfexport = new PdfExportImpl();
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         String html = getHeader() + "<p>Hello</p>" + getFooter();
         pdfexport.exportHtml(html, out, 0);
@@ -62,7 +62,7 @@
     }
 
     public void testPDFConversionWithTable() throws XWikiException {
-        PdfExportImpl pdfexport = new PdfExportImpl();
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         String html = getHeader() + "<table><tr><td>Hello</td><td>Ah</td></tr><tr><td>Hello</td><td>Ah</td><td>Hi</td></tr></table>" + getFooter();
         pdfexport.exportHtml(html, out, 0);
@@ -71,7 +71,7 @@
     }
 
     public void testPDFConversionWithEmptyTable() throws XWikiException {
-        PdfExportImpl pdfexport = new PdfExportImpl();
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         String html = getHeader() + "<table></table>" + getFooter();
         pdfexport.exportHtml(html, out, 0);
@@ -80,7 +80,7 @@
     }
 
     public void testPDFConversionWithTableWithNoCols() throws XWikiException {
-        PdfExportImpl pdfexport = new PdfExportImpl();
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         String html = getHeader() + "<table><tr></tr><tr></tr></table>" + getFooter();
         pdfexport.exportHtml(html, out, 0);
@@ -89,7 +89,7 @@
     }
 
     public void testPDFConversionWithImage() throws XWikiException {
-        PdfExportImpl pdfexport = new PdfExportImpl();
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         String html = getHeader() + "<img src=\"toto.gif\" />" + getFooter();
         pdfexport.exportHtml(html, out, 0);
Index: src/main/java/com/xpn/xwiki/pdf/impl/PdfExportImpl.java
===================================================================
--- src/main/java/com/xpn/xwiki/pdf/impl/PdfExportImpl.java	(Revision 977)
+++ src/main/java/com/xpn/xwiki/pdf/impl/PdfExportImpl.java	(Arbeitskopie)
@@ -41,12 +41,13 @@
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.commons.lang.RandomStringUtils;
-import org.apache.fop.apps.Driver;
+import org.apache.fop.apps.Driver;
+import org.apache.fop.apps.Options;
 import org.w3c.dom.Document;
 import org.w3c.tidy.Configuration;
 import org.w3c.tidy.Tidy;
 import org.xml.sax.InputSource;
-
+
 import com.xpn.xwiki.XWikiContext;
 import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.doc.XWikiDocument;
@@ -59,19 +60,42 @@
     private String fopxsl = "fop.xsl";
     private static final int PDF = 0;
     private static final int RTF = 1;
-
-    public PdfExportImpl() {
-        tidy = new Tidy();
-        Properties props = new Properties();
-        props.setProperty("quiet", "true");
-        props.setProperty("quoteAmpersand", "true");
-        props.setProperty("xHtml", "true");
-        props.setProperty("showWarnings", "false");
-        props.setProperty("tidyMark", "false");
-        props.setProperty("clean", "true");
-        tidy.setConfigurationFromProps(props);
-        tidy.setCharEncoding(Configuration.LATIN1);
+
+    // FOP is not thread safe for configration, so do it in a static block
+    static {
+        try {
+            InputStream cfg = PdfExportImpl.class.getResourceAsStream("/fop.cfg.xml"); 
+            new Options(cfg);
+            // change the font base dir to WEB-INF/classes/fonts
+            // note that this really has to be a string!
+            org.apache.fop.configuration.Configuration.put("fontBaseDir",
+                    PdfExportImpl.class.getResource("/fonts").toString());
+        } catch (Exception e) {
+            // should never happen...
+            e.printStackTrace();
+        } 
+    }
+    
+    public PdfExportImpl(XWikiContext context) {
+        this(context.getWiki().getEncoding());
     }
+
+    private PdfExportImpl(String encoding) {
+        tidy = new Tidy();
+        Properties props = new Properties();
+        props.setProperty("quiet", "true");
+        props.setProperty("quoteAmpersand", "true");
+        props.setProperty("xHtml", "true");
+        props.setProperty("showWarnings", "false");
+        props.setProperty("tidyMark", "false");
+        props.setProperty("clean", "true");
+        tidy.setConfigurationFromProps(props);
+        if ("UTF-8".equals(encoding)) {
+            tidy.setCharEncoding(Configuration.UTF8);
+        } else {
+            tidy.setCharEncoding(Configuration.LATIN1);
+        }
+    }
 
     public String getXhtmlxsl() {
         return xhtmlxsl;
@@ -194,7 +218,7 @@
         String inputfile;
         String outputfile;
         String content;
-        PdfExportImpl pdf = new PdfExportImpl();
+        PdfExportImpl pdf = new PdfExportImpl(System.getProperty("file.encoding", "ISO-8859-1"));
 
         if (param.equals("-html2xhtml")) {
             // HTML TO XHTML
Index: src/main/java/com/xpn/xwiki/web/PDFAction.java
===================================================================
--- src/main/java/com/xpn/xwiki/web/PDFAction.java	(Revision 977)
+++ src/main/java/com/xpn/xwiki/web/PDFAction.java	(Arbeitskopie)
@@ -34,8 +34,8 @@
 	public String render(XWikiContext context) throws XWikiException {
         XWikiURLFactory urlf = context.getWiki().getURLFactoryService().createURLFactory(XWikiContext.MODE_PDF, context);
         context.setURLFactory(urlf);
-        PdfExportImpl pdfexport = new PdfExportImpl();
         XWikiDocument doc = context.getDoc();
+        PdfExportImpl pdfexport = new PdfExportImpl(context);
         handleRevision(context);
             
         try {
Index: src/main/resources/xhtml2fo.xsl
===================================================================
--- src/main/resources/xhtml2fo.xsl	(Revision 977)
+++ src/main/resources/xhtml2fo.xsl	(Arbeitskopie)
@@ -64,7 +64,8 @@
 
     <xsl:attribute-set name="body">
         <!-- specified on fo:flow's only child fo:block -->
         <xsl:attribute name="font-size">0.75em</xsl:attribute>
+        <!-- xsl:attribute name="font-family">Mincho</xsl:attribute -->
     </xsl:attribute-set>
 
     <xsl:attribute-set name="page-header">
Index: build.xml
===================================================================
--- build.xml	(Revision 977)
+++ build.xml	(Arbeitskopie)
@@ -223,6 +223,8 @@
             <fileset dir="${build.dir}/web/WEB-INF">
                 <include name="hibernate.cfg.xml" />
             </fileset>
+            <fileset includes="fonts"
+                dir="${main.src.dir}" />
         </copy>
 
     </target>
