[jboss-jira] [JBoss JIRA] (JBRULES-2936) Importing decision table from Excel: Non Ascii chars should not be corrupted

Khalil Ghasemzadeh (JIRA) jira-events at lists.jboss.org
Tue Jun 25 10:19:21 EDT 2013


    [ https://issues.jboss.org/browse/JBRULES-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784353#comment-12784353 ] 

Khalil Ghasemzadeh commented on JBRULES-2936:
---------------------------------------------

I had same problem in loading Persian characters. This problem is solved by fixing two lines of code:
 
org.drools.rule.builder.dialect.java.JavaDialect.addClassCompiledTask(final String className, final BaseDescr descr, final String text, final MemoryResourceReader src, final ErrorHandler handler):

   src.add(fileName, text.getBytes()) --> src.add(fileName, text.getBytes(Charset.forName("UTF-8"))

org.drools.commons.jci.compilers.EclipseJavaCompiler. getContents():

   return new String(content).toCharArray() --> return new String(content, Charset.forName("UTF-8")).toCharArray()

                
> Importing decision table from Excel: Non Ascii chars should not be corrupted
> ----------------------------------------------------------------------------
>
>                 Key: JBRULES-2936
>                 URL: https://issues.jboss.org/browse/JBRULES-2936
>             Project: JBRULES
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Geoffrey De Smet
>             Fix For: 6.0.0.Alpha1
>
>
> see
> http://stackoverflow.com/questions/5298748/guvnor-rules-encoding
> Excel (like windows) probably has crappy encoding standardization (as in none at all), so I suspect that we 'll need to ask the excel document what encoding (or even what locale) it is and read the data in that encoding.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list