tika-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From max...@apache.org
Subject svn commit: r1304224 - /tika/trunk/tika-server/src/main/java/org/apache/tika/server/TikaResource.java
Date Fri, 23 Mar 2012 08:29:59 GMT
Author: maxcom
Date: Fri Mar 23 08:29:59 2012
New Revision: 1304224

URL: http://svn.apache.org/viewvc?rev=1304224&view=rev
Log:
TikaResource: force UTF-8 output

Modified:
    tika/trunk/tika-server/src/main/java/org/apache/tika/server/TikaResource.java

Modified: tika/trunk/tika-server/src/main/java/org/apache/tika/server/TikaResource.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-server/src/main/java/org/apache/tika/server/TikaResource.java?rev=1304224&r1=1304223&r2=1304224&view=diff
==============================================================================
--- tika/trunk/tika-server/src/main/java/org/apache/tika/server/TikaResource.java (original)
+++ tika/trunk/tika-server/src/main/java/org/apache/tika/server/TikaResource.java Fri Mar
23 08:29:59 2012
@@ -40,9 +40,7 @@ import org.xml.sax.SAXException;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.*;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -130,7 +128,9 @@ public class TikaResource {
 
     return new StreamingOutput() {
       public void write(OutputStream outputStream) throws IOException, WebApplicationException
{
-        BodyContentHandler body = new BodyContentHandler(new WriteOutContentHandler(outputStream)
{
+        Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
+
+        BodyContentHandler body = new BodyContentHandler(new WriteOutContentHandler(writer)
{
           @Override
           public void startElement(String uri, String localName, String qName, Attributes
attributes) throws SAXException {
             super.startElement(uri, localName, qName, attributes);



Mime
View raw message