cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/parser XercesParser.java
Date Thu, 20 Apr 2000 22:29:43 GMT
stefano     00/04/20 15:29:43

  Modified:    src/org/apache/cocoon Engine.java
               src/org/apache/cocoon/parser XercesParser.java
  Log:
  added hopefully last encoding fixes (gee, thinking i18n is hard!)
  
  Revision  Changes    Path
  1.22      +10 -3     xml-cocoon/src/org/apache/cocoon/Engine.java
  
  Index: Engine.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Engine.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Engine.java	2000/04/08 00:46:26	1.21
  +++ Engine.java	2000/04/20 22:29:41	1.22
  @@ -1,4 +1,4 @@
  -/*-- $Id: Engine.java,v 1.21 2000/04/08 00:46:26 stefano Exp $ --
  +/*-- $Id: Engine.java,v 1.22 2000/04/20 22:29:41 stefano Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -73,7 +73,7 @@
    * This class implements the engine that does all the document processing.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.21 $ $Date: 2000/04/08 00:46:26 $
  + * @version $Revision: 1.22 $ $Date: 2000/04/20 22:29:41 $
    */
   
   public class Engine implements Defaults {
  @@ -316,7 +316,14 @@
   
                       // fill the page bean with content
                       page.setContent(writer.toString());
  -                    page.setContentType(formatter.getMIMEType());
  +
  +                    // set content type together with encoding if appropriate
  +                    String encoding = formatter.getEncoding();
  +                    if (encoding != null) {
  +                        page.setContentType(formatter.getMIMEType() + "; charset=" + encoding);
  +                    } else {
  +                        page.setContentType(formatter.getMIMEType());
  +                    }                    
   
                       // page is done without memory errors so exit the loop
                       break;
  
  
  
  1.8       +3 -2      xml-cocoon/src/org/apache/cocoon/parser/XercesParser.java
  
  Index: XercesParser.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/parser/XercesParser.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XercesParser.java	2000/02/13 18:29:29	1.7
  +++ XercesParser.java	2000/04/20 22:29:42	1.8
  @@ -1,4 +1,4 @@
  -/*-- $Id: XercesParser.java,v 1.7 2000/02/13 18:29:29 stefano Exp $ --
  +/*-- $Id: XercesParser.java,v 1.8 2000/04/20 22:29:42 stefano Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -63,7 +63,7 @@
    * This class implements an XML parser using the Apache Xerces XML parser.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.7 $ $Date: 2000/02/13 18:29:29 $
  + * @version $Revision: 1.8 $ $Date: 2000/04/20 22:29:42 $
    */
   
   public class XercesParser extends AbstractParser implements Status {
  @@ -79,6 +79,7 @@
           parser.setFeature("http://apache.org/xml/features/validation/warn-on-undeclared-elemdef",
validate);
           parser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes",
false);
           parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
  +        parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true);
           parser.parse(input);
           return parser.getDocument();
       }
  
  
  

Mime
View raw message