[
https://issues.apache.org/jira/browse/CAMEL-8356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14322013#comment-14322013
]
Stefan Mandel edited comment on CAMEL-8356 at 2/15/15 3:07 PM:
---------------------------------------------------------------
The third unit test (I just replaced the old test file attachment) shows that
the returned byte stream is the same as a pure FileInputStream.
This seems strange, because anybody can see that the implementation does use
the specified charset. However the Streaming-Pipeline
(Stream->BufferedReader->Stream) seems to loose it.
As I said - i can hunt this bug down, but yet I am not certain if a majority
recognizes this behaviour as bug.
was (Author: almond):
The third unit test shows that the returned byte stream is the same as a pure
FileInputStream.
This seems strange, because anybody can see that the implementation does use
the specified charset. However the Streaming-Pipeline
(Stream->BufferedReader->Stream) seems to loose it.
As I said - i can hunt this bug down, but yet I am not certain if a majority
recognizes this behaviour as bug.
> 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
> Attachments: 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)