0

i want to create a PDF File via Apache FOP on my MAC that includes spacial characters. if the XML File contains special characters like "ä","ö"."ü" or"ß" the characters will shown false like "Ã#". If i write some special characters manually in the xsl file, they will shown right.

Has anyone an idea?

Sincerely

user2942606
  • 43
  • 1
  • 2
  • 7
  • Looks like an encoding issue somewhere, how are you reading the input xml file? That looks suspiciously like the xml file is encoded using UTF-8 but you're reading it using a single byte encoding like MacRoman. – Ian Roberts Jan 11 '15 at 11:55

1 Answers1

0

A probably related question: XSL FO : Multiple language pdf using french,German and Italian characters

You could have an encoding problem in your FO file, as the special characters you cite are visualized correctly using FOP's defaults, with no particular font configuration.

(I tested using FOP 1.1 and this simple FO file:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master master-name="one">
            <fo:region-body />
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="one">
        <fo:flow flow-name="xsl-region-body">
            <fo:block>File contains special characters like ä, ö, ü or ß.</fo:block>
        </fo:flow>
    </fo:page-sequence>
</fo:root>

)

I would suggest checking the character encoding of your input XML file (probably UTF-8), and whether it is properly handled in the XSLT transformation (if you use code, check if the files are read and written using the proper encoding).

Community
  • 1
  • 1
lfurini
  • 3,729
  • 4
  • 30
  • 48