camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Mandel (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-8356) IOConverter.toInputStream(file, charset) returns strange behaving stream
Date Sat, 28 Feb 2015 12:55:05 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-8356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14341505#comment-14341505
] 

Stefan Mandel edited comment on CAMEL-8356 at 2/28/15 12:54 PM:
----------------------------------------------------------------

I reviewed your patch and I think we both made a mistake.

My intension was to provide an Inputstream which could be read by any unparameterized reader
/ wrapper stream. I will attach a patch for the tests and a fix for IOConverter.toInputStream.

Your cleanup made obvious that my fix converts the stream to UTF-8, which could only be read
by readers with UTF-8 (instead of default) input encoding.

The attachment will fix CAMEL-8346 for branch 2.14 but unfortunately breaks branch 2.15. You
cannot apply this attachment to branch 2.15.x without another fix for CAMEL-8346.

Notify me if you want to apply this patch. I will try to provide a patch for CAMEL-8346 on
branch 2.15.x then.







was (Author: almond):
I reviewed your patch and I think we both made a mistake.

My intension was to provide an Inputstream which could be read by any unparameterized reader
/ wrapper stream. I will attach a patch for the tests and a fix for IOConverter.toInputStream.

Your cleanup made obvious that my fix converts the stream to UTF-8, which could only be read
by readers with UTF-8 (instead of default) input encoding.

The attachment will fix CAMEL-8346 for branch 2.14 but unfortunately breaks branch 2.15.






> IOConverter.toInputStream(file, charset) returns strange behaving stream
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-8356
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8356
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.14.1, 2.15.0
>            Reporter: Stefan Mandel
>            Assignee: Willem Jiang
>             Fix For: 2.14.2, 2.15.0
>
>         Attachments: CAMEL8356-repaired-Test-and-adjusted-converter-imple.patch, IOConverterCharsetTest.java,
german.iso-8859-1.txt, german.utf-8.txt
>
>
> Calling IOConverter.toInputStream with either UTF-8 or ISO-8859-1 returns a stream that
behaves strange on non-ascii-characters:
> - putting this stream into an InputStreamReader will return false encoded characters
> - a naive new BufferedReader(new InputStreamReader(new FileInputStream(file), charset))
will return the correctly encoded characters.
> I will attach some unit tests for this case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message