Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14125

Task comment internationalization in Camunda rest-engine

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.17.0, 7.17.0-alpha3
    • 7.14.x, 7.15.x, 7.16.x, 7.17.0
    • engine
    • None

      Environment:

      • Any non-docker Camunda distro (all supported versions)
      • Any database
      • Operating system with non-UTF-8 standard encoding

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      Task comments with Persian characters are not saved correctly.

      Steps to reproduce (Required on creation):

      • Create a comment on task with following rest API call: POST /task/<id>/comment/create
        • message in Unicode (Persian), for example این نمونه است
      • Retrieve the comment using this API: GET /task/<id>/comment/<commentId>
        *The message in response is ?? ???

      Observed Behavior (Required on creation):

      After saving a comment with message این نمونه است, the persisted message is ??? ??

      Expected behavior (Required on creation):

      The correct characters are persisted in the database.

      Root Cause (Required on prioritization):

      The message is saved in a BLOB database column. When converting the String to Bytes, the character encoding is not set.

      Without a specified encoding, the default encoding is used (which is probably UTF-8 in the docker container) but differs from system to system (mine was ISO_8859_1).

      Solution Ideas (Optional):

      Set the character encoding to UTF-8 when converting the message to bytes.

      https://github.com/camunda/camunda-bpm-platform/blob/e8411f499a28bd9262045ae966283a786dce901d/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/CommentEntity.java#L62

      Hints (optional):

        This is the controller panel for Smart Panels app

          1. image(4).png
            image(4).png
            22 kB
          2. image-2021-11-21-15-45-22-871.png
            image-2021-11-21-15-45-22-871.png
            110 kB
          3. screenshot-1.png
            screenshot-1.png
            247 kB
          4. screenshot-2.png
            screenshot-2.png
            263 kB

            [CAM-14125] Task comment internationalization in Camunda rest-engine

            I tested adding and getting comments using arabic langaguge on REST API and it works well

            tested using lattest docker image

            Gamal Mokhtar Alkzaz added a comment - I tested adding and getting comments using arabic langaguge on REST API and it works well tested using lattest docker image

            Hello,

            Thank you for your reply.

            I am using Camunda rest-engine (camunda-bpm-tomcat-7.15.0 as the Pre-Packaged and pre-configed camunda on tomcat downloaded from main page of Camunda:

            https://downloads.camunda.cloud/release/camunda-bpm/tomcat/7.16/camunda-bpm-tomcat-7.15.0.zip

            which has the above bug

            Simin Ghasemi added a comment - Hello, Thank you for your reply. I am using Camunda rest-engine (camunda-bpm-tomcat-7.15.0 as the Pre-Packaged and pre-configed camunda on tomcat downloaded from main page of Camunda: https://downloads.camunda.cloud/release/camunda-bpm/tomcat/7.16/camunda-bpm-tomcat-7.15.0.zip which has the above bug

            Gamal Mokhtar Alkzaz added a comment - - edited

            the docker image i used is camunda 7.15.0 on tomcat can you verify with this

            docker run --name camunda_test_comment -p 8080:8080 camunda/camunda-bpm-platform:latest
            

            Gamal Mokhtar Alkzaz added a comment - - edited the docker image i used is camunda 7.15.0 on tomcat can you verify with this docker run --name camunda_test_comment -p 8080:8080 camunda/camunda-bpm-platform:latest

            Thanks Simin for raising this issue.

            I was able to reproduce it locally with two different databases. Like galkzaz said, it works properly with the docker image.

            Let me look into this, I will come back to you with my findings.

            Best,
            Miklas

            Miklas Boskamp added a comment - Thanks Simin for raising this issue. I was able to reproduce it locally with two different databases. Like galkzaz said, it works properly with the docker image. Let me look into this, I will come back to you with my findings. Best, Miklas

            Miklas Boskamp added a comment - - edited

            Simin,

            thanks again for raising this issue. I identified the root cause and updated the ticket description.
            This will probably be an easy fix. However, would you be interested in providing a pull request?

            To resolve the issue on your side, you can probably just set your system's standard character encoding to UTF-8 or use the docker image we provide.

            Let me know if you would like to implement a fix.

            Best,
            Miklas

            Miklas Boskamp added a comment - - edited Simin , thanks again for raising this issue. I identified the root cause and updated the ticket description. This will probably be an easy fix. However, would you be interested in providing a pull request? To resolve the issue on your side, you can probably just set your system's standard character encoding to UTF-8 or use the docker image we provide. Let me know if you would like to implement a fix. Best, Miklas

            plz update task title from(Task commnet) to (Task comment)

            Gamal Mokhtar Alkzaz added a comment - plz update task title from(Task commnet) to (Task comment)

            Hi Simin,

            FYI: While working on this ticket I learned that the default charset of Windows (ISO-8859-1) does not support Arabic characters. Maybe this was an issue in your setup as well.

            With the fix I implemented, you will be able to use the process engine configuration flag defaultCharset or defaultCharsetName to configure the encoding that the engine will use.

            I hope this will work for you.

            Best,
            Miklas

            Miklas Boskamp added a comment - Hi Simin , FYI: While working on this ticket I learned that the default charset of Windows (ISO-8859-1) does not support Arabic characters. Maybe this was an issue in your setup as well. With the fix I implemented, you will be able to use the process engine configuration flag defaultCharset or defaultCharsetName to configure the encoding that the engine will use. I hope this will work for you. Best, Miklas

              miklas.boskamp Miklas Boskamp
              Simin Simin Ghasemi
              Miklas Boskamp Miklas Boskamp
              Tassilo Weidner Tassilo Weidner
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: