maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r701061 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src: main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Date Thu, 02 Oct 2008 09:58:22 GMT
Author: vsiveton
Date: Thu Oct  2 02:58:21 2008
New Revision: 701061

URL: http://svn.apache.org/viewvc?rev=701061&view=rev
Log:
DOXIA-185: Add encoding support

o added meta tag to specify UTF-8
o updated tests

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java?rev=701061&r1=701060&r2=701061&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
Thu Oct  2 02:58:21 2008
@@ -32,7 +32,8 @@
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * Xhtml sink implementation.
+ * Xhtml sink implementation. <br/>
+ * <b>Note</b>: The encoding used is UTF-8.
  *
  * @author Jason van Zyl
  * @author ltheussl
@@ -103,6 +104,9 @@
     {
         setHeadFlag( false );
 
+        // always UTF-8
+        write( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>"
);
+
         writeEndTag( Tag.HEAD );
     }
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java?rev=701061&r1=701060&r2=701061&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Thu Oct  2 02:58:21 2008
@@ -81,7 +81,8 @@
     /** {@inheritDoc} */
     protected String getHeadBlock()
     {
-        return "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html
xmlns=\"http://www.w3.org/1999/xhtml\"><head></head>";
+        return "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
+
+                "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta
http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head>";
     }
 
     /** {@inheritDoc} */



Mime
View raw message