Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-214

deficit of InputStreamReader support in anonymous class of ContentStream

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      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,

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ryantxu Ryan McKinley
                Reporter:
                koji Koji Sekiguchi
              • Votes:
                2 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: