maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r712557 - in /maven/doxia/doxia/trunk: doxia-book/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/ doxia-book/src/test/resources/expected/doc-book/ doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven...
Date Sun, 09 Nov 2008 21:26:05 GMT
Author: hboutemy
Date: Sun Nov  9 13:26:04 2008
New Revision: 712557

URL: http://svn.apache.org/viewvc?rev=712557&view=rev
Log:
DOXIA-185: don't ignore encoding when writing text Sinks, output encoding is not limited to
UTF-8 any more

Modified:
    maven/doxia/doxia/trunk/doxia-book/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
    maven/doxia/doxia/trunk/doxia-book/src/test/resources/expected/doc-book/plexus-user-guide.xml
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookIdentityTest.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java

Modified: maven/doxia/doxia/trunk/doxia-book/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-book/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
Sun Nov  9 13:26:04 2008
@@ -230,7 +230,7 @@
      */
     protected String getBookBlock()
     {
-        return "<!DOCTYPE book PUBLIC \"" + DocBookSink.DEFAULT_XML_PUBLIC_ID
+        return "<?xml version='1.0'?><!DOCTYPE book PUBLIC \"" + DocBookSink.DEFAULT_XML_PUBLIC_ID
             + "\" \"" + DocBookSink.DEFAULT_XML_SYSTEM_ID + "\"><book></book>";
     }
 

Modified: maven/doxia/doxia/trunk/doxia-book/src/test/resources/expected/doc-book/plexus-user-guide.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/test/resources/expected/doc-book/plexus-user-guide.xml?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/test/resources/expected/doc-book/plexus-user-guide.xml
(original)
+++ maven/doxia/doxia/trunk/doxia-book/src/test/resources/expected/doc-book/plexus-user-guide.xml
Sun Nov  9 13:26:04 2008
@@ -1,4 +1,4 @@
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+<?xml version='1.0'?><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
 <book><bookinfo><title>Test Book</title>
 </bookinfo>

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
Sun Nov  9 13:26:04 2008
@@ -40,8 +40,6 @@
 
 /**
  * Docbook Sink implementation.
- * <br/>
- * <b>Note</b>: The encoding used is UTF-8.
  *
  * @version $Id$
  * @since 1.0
@@ -139,6 +137,8 @@
 
     private boolean skip;
 
+    private String encoding;
+
     /**
      * Constructor, initialize the Writer.
      *
@@ -147,7 +147,21 @@
      */
     protected DocBookSink( Writer writer )
     {
+        this( writer, null );
+    }
+
+    /**
+     * Constructor, initialize the Writer and tells which encoding is used.
+     *
+     * @param writer not null writer to write the result.
+     * @param encoding the encoding used, that should be written to the generated HTML content
+     * if not <code>null</code>.
+     */
+    protected DocBookSink( Writer writer, String encoding )
+    {
         this.out = new PrintWriter( writer );
+        this.encoding = encoding;
+
         setItalicElement( "<emphasis>" );
         setBoldElement( "<emphasis role=\"bold\">" );
         setMonospacedElement( "<literal>" );
@@ -230,25 +244,24 @@
     }
 
     /**
-     * Sets the encoding.
+     * Sets the encoding. The encoding specified here must be consistent with then encoding
+     * used in the Writer used by this DocBookSink instance.
      *
      * @param enc the encoding to set.
-     * @deprecated since 1.0, this method as no more effect. The encoding is always UTF-8.
      */
     public void setEncoding( String enc )
     {
-        // nop
+        encoding = enc;
     }
 
     /**
-     * Returns the UTF-8 encoding.
+     * Returns the encoding.
      *
-     * @return always return UTF-8.
-     * @deprecated since 1.0, this method as no more effect. The encoding is always UTF-8.
+     * @return the encoding set (can be <code>null</code>).
      */
     public String getEncoding()
     {
-        return "UTF-8";
+        return encoding;
     }
 
     /**
@@ -535,6 +548,13 @@
     {
         if ( xmlMode )
         {
+            markup( "<?xml version='1.0'" );
+            if ( encoding != null )
+            {
+                markup( " encoding='" + encoding + "'" );
+            }
+            markup( "?>" );
+
             if ( styleSheet != null )
             {
                 markup( "<?xml-stylesheet type=\"text/css\" href=\"" + styleSheet + "\"
?>" );

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
Sun Nov  9 13:26:04 2008
@@ -38,7 +38,6 @@
     /** {@inheritDoc} */
     public Sink createSink( Writer writer, String encoding )
     {
-        // TODO: don't ignore encoding parameter
-        return new DocBookSink( writer );
+        return new DocBookSink( writer, encoding );
     }
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookIdentityTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookIdentityTest.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookIdentityTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookIdentityTest.java
Sun Nov  9 13:26:04 2008
@@ -35,7 +35,7 @@
     /** {@inheritDoc} */
     protected Sink createSink( Writer writer )
     {
-        return new DocBookSink( writer );
+        return new DocBookSink( writer, "UTF-8" );
     }
 
     /** {@inheritDoc} */

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
Sun Nov  9 13:26:04 2008
@@ -31,6 +31,7 @@
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkEventElement;
 import org.apache.maven.doxia.sink.SinkEventTestingSink;
+import org.codehaus.plexus.util.IOUtil;
 
 /**
  * @author <a href="mailto:lars@trieloff.net">Lars Trieloff</a>
@@ -72,7 +73,6 @@
         throws IOException, ParseException
     {
         Writer writer = null;
-
         Reader reader = null;
 
         try
@@ -86,15 +86,8 @@
         }
         finally
         {
-            if ( writer  != null )
-            {
-                writer.close();
-            }
-
-            if ( reader != null )
-            {
-                reader.close();
-            }
+            IOUtil.close( reader );
+            IOUtil.close( writer );
         }
     }
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookSinkTest.java
Sun Nov  9 13:26:04 2008
@@ -39,7 +39,7 @@
     /** {@inheritDoc} */
     protected Sink createSink( Writer writer )
     {
-        return new DocBookSink( writer );
+        return new DocBookSink( writer, "UTF-8" );
     }
 
     /** {@inheritDoc} */

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
Sun Nov  9 13:26:04 2008
@@ -35,12 +35,10 @@
 
 /**
  * FO Sink implementation.
- * <br/>
- * <b>Note</b>: The encoding used is UTF-8.
  *
  * @author ltheussl
  * @version $Id$
- * @since 1.0
+ * @since 1.0-beta-1
  */
 public class FoSink
     extends AbstractXmlSink
@@ -79,6 +77,8 @@
     /** Verbatim flag. */
     private boolean verbatim;
 
+    private String encoding;
+
     /**
      * Constructor, initialize the Writer.
      *
@@ -87,7 +87,20 @@
      */
     protected FoSink( Writer writer )
     {
+        this( writer, "UTF-8" );
+    }
+
+    /**
+     * Constructor, initialize the Writer and tells which encoding is used.
+     *
+     * @param writer not null writer to write the result.
+     * @param encoding the encoding used, that should be written to the generated HTML content
+     * if not <code>null</code>.
+     */
+    protected FoSink( Writer writer, String encoding )
+    {
         this.out = writer;
+        this.encoding = encoding;
         this.config = new FoConfiguration();
 
         setNameSpace( "fo" );
@@ -975,6 +988,13 @@
      */
     public void beginDocument()
     {
+        write( "<?xml version='1.0'" );
+        if ( encoding != null )
+        {
+            write( " encoding='" + encoding + "'" );
+        }
+        write( "?>" );
+
         writeStartTag( ROOT_TAG, "xmlns:" + getNameSpace(), "http://www.w3.org/1999/XSL/Format"
);
 
         writeStartTag( LAYOUT_MASTER_SET_TAG, "" );

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
Sun Nov  9 13:26:04 2008
@@ -29,7 +29,7 @@
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
  * @version $Id$
- * @since 1.0
+ * @since 1.0-beta-1
  * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="fo"
  */
 public class FoSinkFactory
@@ -38,7 +38,6 @@
     /** {@inheritDoc} */
     public Sink createSink( Writer writer, String encoding )
     {
-        // TODO: don't ignore encoding parameter
-        return new FoSink( writer );
+        return new FoSink( writer, encoding );
     }
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
Sun Nov  9 13:26:04 2008
@@ -56,8 +56,6 @@
  * See http://sourceforge.net/tracker/index.php?func=detail&aid=786427&group_id=15255&atid=115255.</li>
  * <li>Images could be on another page and next text on the last one.</li>
  * </ul>
- * <br/>
- * <b>Note</b>: The encoding used is UTF-8.
  *
  * @see <a href="http://www.lowagie.com/iText/tutorial/ch07.html">http://www.lowagie.com/iText/tutorial/ch07.html</a>
  *
@@ -110,13 +108,18 @@
      */
     protected ITextSink( Writer writer )
     {
-        this.writer = writer;
+        this( writer, "UTF-8" );
+    }
 
-        actionContext = new SinkActionContext();
-        font = new ITextFont();
-        header = new ITextHeader();
+    /**
+     * @param writer
+     * @param encoding
+     */
+    protected ITextSink( Writer writer, String encoding )
+    {
+        this( new PrettyPrintXMLWriter( writer, encoding, null ) );
 
-        xmlWriter = new PrettyPrintXMLWriter( this.writer, "UTF-8", null );
+        this.writer = writer;
         writeStart = true;
     }
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
Sun Nov  9 13:26:04 2008
@@ -40,8 +40,7 @@
     /** {@inheritDoc} */
     public Sink createSink( Writer writer, String encoding )
     {
-        // TODO: don't ignore encoding parameter
-        return new ITextSink( writer );
+        return new ITextSink( writer, encoding );
     }
 
     public Sink createSink( Writer writer )
@@ -53,7 +52,7 @@
     /**
      * Create a <code>Sink</code> into a PrettyPrintXMLWriter.
      *
-     * @param xmlWriter not null XML writer to write the result. <b>Should</b>
be an UTF-8 Writer.
+     * @param xmlWriter not null XML writer to write the result.
      * @return a <code>Sink</code> instance.
      */
     public Sink createSink( PrettyPrintXMLWriter xmlWriter )

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
Sun Nov  9 13:26:04 2008
@@ -33,8 +33,6 @@
 
 /**
  * Xdoc Sink implementation.
- * <br/>
- * <b>Note</b>: The encoding used is UTF-8.
  *
  * @author <a href="mailto:james@jamestaylor.org">James Taylor</a>
  * @version $Id$
@@ -51,6 +49,8 @@
     /** An indication on if we're inside a box (verbatim). */
     private boolean boxedFlag;
 
+    private String encoding;
+
     // ----------------------------------------------------------------------
     // Constructors
     // ----------------------------------------------------------------------
@@ -66,6 +66,19 @@
         super( writer );
     }
 
+    /**
+     * Constructor, initialize the Writer and tells which encoding is used.
+     *
+     * @param writer not null writer to write the result.
+     * @param encoding the encoding used, that should be written to the generated HTML content
+     * if not <code>null</code>.
+     */
+    protected XdocSink( Writer writer, String encoding )
+    {
+        this( writer );
+        this.encoding = encoding;
+    }
+
     // ----------------------------------------------------------------------
     // Public protected methods
     // ----------------------------------------------------------------------
@@ -90,6 +103,13 @@
 
         setHeadFlag( true );
 
+        write( "<?xml version='1.0'" );
+        if ( encoding != null )
+        {
+            write( " encoding='" + encoding + "'" );
+        }
+        write( "?>" );
+
         writeStartTag( DOCUMENT_TAG );
 
         writeStartTag( PROPERTIES_TAG );

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
Sun Nov  9 13:26:04 2008
@@ -38,7 +38,6 @@
     /** {@inheritDoc} */
     public Sink createSink( Writer writer, String encoding )
     {
-        // TODO: don't ignore encoding parameter
-        return new XdocSink( writer );
+        return new XdocSink( writer, encoding );
     }
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java?rev=712557&r1=712556&r2=712557&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
Sun Nov  9 13:26:04 2008
@@ -42,7 +42,7 @@
     /** {@inheritDoc} */
     protected Sink createSink( Writer writer )
     {
-        return new XdocSink( writer );
+        return new XdocSink( writer, "UTF-8" );
     }
 
     /** {@inheritDoc} */
@@ -72,7 +72,7 @@
     /** {@inheritDoc} */
     protected String getHeadBlock()
     {
-        return "<document><properties></properties>";
+        return "<?xml version='1.0' encoding='UTF-8'?><document><properties></properties>";
     }
 
     /** {@inheritDoc} */



Mime
View raw message