cancel
Showing results for 
Search instead for 
Did you mean: 

Encoding problem after update from 5.10 to 5.12.1

alemser
Champ in-the-making
Champ in-the-making
Hi,

Today I had to upgrade the version of Activiti in my application.
After I did that, tasks with the name 'Relatório', for exemple,  was presented as 'Relat?rio'.
This happens after I deploy a new process.

Any idea of what is happening?
10 REPLIES 10

alemser
Champ in-the-making
Champ in-the-making
Adding more information, I think the problem (its a problem for me, at least) happens in the org.activiti.bpmn.converter.BpmnXMLConverter.
Inside this class is used UTF-8 encoding hardcoded, with no other way to override with another.

Since the early versions of Activiti I was using the ISO-8859-1 encoding and now this version breaks. I need to upgrade to solve this Jira issue: https://jira.codehaus.org/browse/ACT-1605?focusedCommentId=322731&page=com.atlassian.jira.plugin.sys...

There is a way to help me?

Thanks.

frederikherema1
Star Contributor
Star Contributor
What specific chars do you use that are part of ISO-8859-1? Can you update the process-definitions to be UTF-8 (you can alter the ACT_GE_BYTEARRAY entry pointing to the definition in worst case)?

We need chars link ã, ç, á and others alike.
I wished to but don't have a cheap way to do so.

We have many applications running with ISO-8859-1 for a long time.
I had tried to mix both encodings (UTF and ISO) but, when an application creates a expression inside the engine using these chars they also create a big encoding problem. For example: ${result == 'Não''}

jbarrez
Star Contributor
Star Contributor
Could you upload such a faulty process definition xml so we can verify?

alemser
Champ in-the-making
Champ in-the-making
The definition below is enough to raise the exception.
If you change the word 'relatório' for 'relatorio', runs green.
<code>
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<definitions id="definitions"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:activiti="http://activiti.org/bpmn"
  targetNamespace="Examples"
  xmlns:tns="Examples"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
 
<message id="writeReport" name="newWriteReport" />
 
 
<process id="process01" isExecutable="true">

        <startEvent id="theStart">
            <messageEventDefinition messageRef="tns:writeReport" />
        </startEvent>
       
        <sequenceFlow id="flow1" sourceRef="theStart" targetRef="writeReportTask" />
       
  <userTask id="writeReportTask" name="Fazer relatório" >
        </userTask>
       
        <sequenceFlow id="flow2" sourceRef="writeReportTask" targetRef="theEnd" />
       
        <endEvent id="theEnd" />
       

</process>
</definitions>
<code>

trademak
Star Contributor
Star Contributor
I have added this example in the EncodingConverterTest in the activiti-bpmn-converter module, but it runs just fine there. If you have a failing unit test, can you please share that as well?

Best regards,

alemser
Champ in-the-making
Champ in-the-making
Ok thank you.
I downloaded from github the teste case.
If I run the test with an UTF-8 eclipse workspace, runs fine too.
But, running from an ISO-8859-1 eclipse workspace the problem occurs.

See, we are developping the applications inside an ISO-8859-1 workspace. Before the 5.12.1 release, everithing was running fine.

To keep the application running I had to extend the StandaloneProcessEngineConfiguration and set a different BpmnParseFactory (there is no easy way to do this). At the end, I had to change from UTF-8 to ISO-8859-1.

In the test case I had tryied to replace the BpmnXMLConverter to my ISO88591BpmnXMLConverter, but does not work. Because the static method writeRootElement of the DefinitionsRootExport class has defined UTF-8 encoding hardcoded.

alemser
Champ in-the-making
Champ in-the-making
Hi,

Any other comments?
At least a easy way to override the implementations…

trademak
Star Contributor
Star Contributor
Hi,

I've made the encoding pluggable and it's available in Github now. You can override the default encoding (UTF-8) by setting the xmlEncoding property in the process engine configuration. In addition you can set the encoding on the input and output methods of the BpmnXMLConverter.

Best regards,