Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4662

Resources added through KieHelper get interpreted using the default character set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 7.10.0.Final, 7.20.0.Final, 7.28.0.Final
    • None
    • None
    • Windows. Can be reproduced on other OSes using "-Dfile.encoding=latin1".

    • 2019 Week 50-52 (from Dec 9)
    • NEW
    • NEW

      When a resource is added using KieHelper.addResource, any specified encoding is ignored when it is added to the MemoryFileSystem by KieFileSystemImpl.write(Resource) (effectively assuming the InputStream is already encoded in UTF-8).

      Additionally, when the resource is read again by AbstractKieModule.getResource, it constructs a Resource object with no encoding specified, whereas it should probably specify an encoding of UTF-8, since it seems that sources are considered to be UTF-8 already at least in the case of the MemoryKieModule.

      I've attached a fairly minimal test case where the rules bytes are passed in UTF-8 with the encoding explicitly specified. This currently produces an error when the default file encoding is not UTF-8 (eg, by passing -Dfile.encoding=latin1 as a JVM argument, or by using the default arguments on Windows).

              mfusco@redhat.com Mario Fusco
              maxzerzouri Max Zerzouri (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: