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

JsonPathEngine skips file encoding

    XMLWordPrintableJSON

Details

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

    Description

      This occurs if one uses the camel file component with a charset parameter, e.g. file:/url?charset=UTF-8. It leads to strange effects:

      1. testing the same utf8-file under linux (default encoding:UTF-8) and german windows (default encoding:windows-1252) leads to problems with german umlauts.
      2. using a file in another encoding than the default (ISO-8859-1 on linux) leads also to problems with german umlauts.
      • Both problems can be reproduced with the attached unit test files in 2.14.1.
      • Problem 1 is hidden in 2.15-SNAPSHOT, because UTF-8 is hard-coded as file encoding (maybe ok, since JSON is almost never used with language specific encondings), Problem 2 also occurs in 2.15-SNAPSHOT

      I can provide or help with a fix (or pull request), if these problems are classified as true defects.

      Attachments

        1. JsonPathSourceTest.java
          4 kB
          Stefan Mandel
        2. germanbooks-utf8.json
          0.6 kB
          Stefan Mandel
        3. germanbooks-iso-8859-1.json
          0.6 kB
          Stefan Mandel

        Issue Links

          Activity

            People

              njiang Willem Jiang
              almond Stefan Mandel
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: