You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2010/07/16 15:20:51 UTC

[jira] Reopened: (SOLR-2003) report errors for wrongly-encoded files in ResourceLoader.getLines()

     [ https://issues.apache.org/jira/browse/SOLR-2003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir reopened SOLR-2003:
-------------------------------


reopening as Mark hit this in cloud tests, but the exception could be friendlier (its from a low level inputstream and doesnt know the filename you were trying to load, etc)

> report errors for wrongly-encoded files in ResourceLoader.getLines()
> --------------------------------------------------------------------
>
>                 Key: SOLR-2003
>                 URL: https://issues.apache.org/jira/browse/SOLR-2003
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 3.1, 4.0
>
>         Attachments: SOLR-2003.patch, SOLR-2003_friendly.patch
>
>
> 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:
> {code}
> decoder = charset.newDecoder().onMalformedInput(
>     CodingErrorAction.REPLACE).onUnmappableCharacter(
>     CodingErrorAction.REPLACE);
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org