You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by jb...@apache.org on 2002/10/18 15:30:00 UTC

cvs commit: xml-xindice/java/src/org/apache/xindice/server XindiceServlet.java

jbates      2002/10/18 06:29:59

  Modified:    java/src/org/apache/xindice/server XindiceServlet.java
  Log:
  Fix for bug 13744
  
  Revision  Changes    Path
  1.4       +6 -5      xml-xindice/java/src/org/apache/xindice/server/XindiceServlet.java
  
  Index: XindiceServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/server/XindiceServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XindiceServlet.java	12 Aug 2002 03:02:46 -0000	1.3
  +++ XindiceServlet.java	18 Oct 2002 13:29:59 -0000	1.4
  @@ -161,14 +161,14 @@
                // TODO: should support XPath queries and maybe other functions.
                
                case URIMapper.DOCUMENT:
  -                res.setContentType("text/xml");
  +                res.setContentType("text/xml; charset=utf-8");
                   resultString = TextWriter.toString( map.getDocument() );
                   break;
   
                case URIMapper.COLLECTION:
                   // TODO: decide whether this should be XML or maybe support an option
                   // for both XML and HTML output.
  -                res.setContentType("text/html");
  +                res.setContentType("text/html; charset=utf-8");
   
                   StringBuffer collections = new StringBuffer();
                   
  @@ -201,10 +201,11 @@
          catch (Exception e) {
             // TODO: need intelligent error handling.
          }
  -              
  -       res.setContentLength (resultString.length());
  +
  +       byte[] resultBytes = resultString.getBytes("utf-8");
  +       res.setContentLength (resultBytes.length);
          OutputStream output = res.getOutputStream();
  -       output.write(resultString.getBytes());
  +       output.write(resultBytes);
          output.flush();
       }