Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8356

IOConverter.toInputStream(file, charset) returns strange behaving stream

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.14.1, 2.15.0
    • 2.14.2, 2.15.0
    • camel-core
    • None
    • Unknown

    Description

      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.

      Attachments

        1. CAMEL8356-repaired-Test-and-adjusted-converter-imple.patch
          5 kB
          Stefan Mandel
        2. german.iso-8859-1.txt
          0.0 kB
          Stefan Mandel
        3. german.utf-8.txt
          0.0 kB
          Stefan Mandel
        4. IOConverterCharsetTest.java
          2 kB
          Stefan Mandel
        5. result.txt
          1 kB
          Sergey Sidashov
        6. source.txt
          2 kB
          Sergey Sidashov

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            njiang Willem Jiang
            almond Stefan Mandel
            Votes:
            0 Vote for this issue
            Watchers:
            6 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment