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

report errors for wrongly-encoded files in ResourceLoader.getLines()

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      ResourceLoader is used to load things like stopwords and synonyms files, but it uses the default 'Charset' argument for this.

      when you open an InputStream with a Charset, you get:

      decoder = charset.newDecoder().onMalformedInput(
          CodingErrorAction.REPLACE).onUnmappableCharacter(
          CodingErrorAction.REPLACE);
      

      For cases like malformed encoded stopwords and synonyms files, I think its more helpful to use CodingErrorAction.REPORT than to silently replace with a replacement char. Then the user gets an exception.

      See: http://www.lucidimagination.com/search/document/1e50cb0992727fa1/foreign_characters_question

        Attachments

        1. SOLR-2003_friendly.patch
          2 kB
          Robert Muir
        2. SOLR-2003.patch
          3 kB
          Robert Muir

          Activity

            People

            • Assignee:
              rcmuir Robert Muir
              Reporter:
              rcmuir Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: