开发者

Special character encoding issue on Solaris with weblogic server

I have an application which uses fop and xslt to generate the PDF file. The special characters as §£?ÐÅÆ are appearing as ???? in PDF.

The weblogic server is running on solaris machine. I have already tried with

<charset-params>
    <input-charset>
        <resource-path>/*</resource-path>
        <java-charset-name>UTF-8</java-charset-name>
    </input-charset>
    <charset-mapping>
     <iana-charset-name>UTF-8</iana-charset-name>
    <java-charset-name>UTF-8</java-charset-name>
 </charset-mapping>     
</charset-params> 

in weblogic.xml.

I ha开发者_运维百科ve also tried with

transformer.setOutputProperty( OutputKeys.METHOD, "xml");
            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
            transformer.setOutputProperty( OutputKeys.INDENT, "yes");
            transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");

Nothing seems to be working over there.


Have you set up fop to find fonts with those characters in? For instance, on Solaris 11 using fop (though not with weblogic) I had to set up paths for fonts in a fop-conf.xml:

<?xml version="1.0"?>
<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
         <!-- register all the fonts found in a directory -->
         <directory>/usr/share/fonts/TrueType/core/</directory>
         <directory>/usr/share/fonts/TrueType/dejavu/</directory>
         <directory>/usr/share/fonts/TrueType/liberation/</directory>
         <directory>/usr/share/fonts/TrueType/unifont/</directory>

         <!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
         <!-- directory recursive="true">C:\MyFonts2</directory -->

         <!-- automatically detect operating system installed fonts -->
         <auto-detect/>
      </fonts>
   </renderer>

   <renderer mime="application/postscript">
      <fonts>
         <directory>/usr/share/fonts/X11/Type1/</directory>
         <directory>/usr/share/ghostscript/fonts/</directory>
         <directory>/usr/share/fonts/TrueType/core/</directory>
         <directory>/usr/share/fonts/TrueType/dejavu/</directory>
         <directory>/usr/share/fonts/TrueType/liberation/</directory>
         <directory>/usr/share/fonts/TrueType/unifont/</directory>
      </fonts>
    </renderer>
</renderers>
</fop>

(Font paths will be different on older versions of Solaris.)

For more details, see:

  • http://xmlgraphics.apache.org/fop/trunk/fonts.html
  • http://www.sagehill.net/docbookxsl/AddFont.html#ConfigFontFop
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜