[
https://issues.apache.org/jira/browse/SOLR-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491938
]
Koji Sekiguchi commented on SOLR-214:
-------------------------------------
> Weird - the javadocs a pretty explicit that request.getReader() should take
> care of the character encoding:
> http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getReader()
Good point. I simply thought the cause of this problem was the deficit of
InputStreamReader support at SOLR-197.
But according to the javadoc, the servlet container should take care of
encoding. We are using Tomcat 5.5.23. We should check out the servlet
container. Thanks.
> deficit of InputStreamReader support in anonymous class of ContentStream
> ------------------------------------------------------------------------
>
> Key: SOLR-214
> URL: https://issues.apache.org/jira/browse/SOLR-214
> Project: Solr
> Issue Type: Bug
> Reporter: Koji Sekiguchi
> Attachments: UseInputStreamReader.patch
>
>
> After SOLR-197 is applied, POSTed Japanese XML contents turn into garbled
> characters in the index.
> I can see the garbled characters through Luke. The issue was never seen
> before SOLR-197.
> The cause of this problem is that the deficit of InputStreamReader support in
> the anonymous class of ContentStream in
> SolrRequestParsers.parseParamsAndFillStreams() method.
> Before SOLR-197, InputStreamReader was used in
> XmlUpdateRequestHandler.handleRequestBody() method:
> // Cycle through each stream
> for( ContentStream stream : req.getContentStreams() ) {
> String charset = getCharsetFromContentType( stream.getContentType() );
> Reader reader = null;
> if( charset == null ) {
> reader = new InputStreamReader( stream.getStream() );
> }
> else {
> reader = new InputStreamReader( stream.getStream(), charset );
> }
> rsp.add( "update", this.update( reader ) );
>
> // Make sure its closed
> try { reader.close(); } catch( Exception ex ){}
> }
> The patch will apply this effect to SolrRequestParsers.
> regards,
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.