You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2008/10/02 11:58:22 UTC
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
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} */