You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2008/10/23 09:44:44 UTC

[jira] Commented: (JCR-1829) PlainTextExtractor throws UnsupportedEncodingException when a text file is inserted into JCR

    [ https://issues.apache.org/jira/browse/JCR-1829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642090#action_12642090 ] 

Marcel Reutegger commented on JCR-1829:
---------------------------------------

I guess there should rather be a guard for unsupported encodings than an empty string. There are a lot more String values for encoding that will throw an UnsupportedEncodingException. I suggest we catch the exception and use the default encoding in that case.


> PlainTextExtractor throws UnsupportedEncodingException when a text file is inserted into JCR
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-1829
>                 URL: https://issues.apache.org/jira/browse/JCR-1829
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-text-extractors
>    Affects Versions: 1.4
>         Environment: Reproduced in Linux and Windows
>            Reporter: hector rovira
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> PlainTextExtractor is failing to index text files.  Searching for content in text files is not coming back with results.
> On the extractText(InputStream stream, String type, String encoding) method, the encoding is coming in as an empty string, and it throws the java.io.UnsupportedEncodingException at line 40 ( return new InputStreamReader(stream, encoding); ).
> modifying the following statement fixes the problem:
> before:  if (encoding != null) {
> after:  if (encoding != null && !encoding.equals("")) {

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