本文介绍了Guvnor规则编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel中有一个Drools决策表,规则中使用的某些字符串带有Á字符。当我从该决策表在Guvnor中构建规则包时,规则源中出现错误字符。

I have a Drools decision table in Excel, and some of the strings used in rules have "Á" characters. When I build rules package in Guvnor from this decision table, I get wrong characters in rules source.

例如

在电子表格中->Áreade Lazer | POR,

in spreadsheet -> Área de Lazer|POR,

在内置的drl文件中-> reade Lazer | POR

in built drl file -> �rea de Lazer|POR

在这种情况下,可以对Guvnor进行任何调整以使其支持UTF-8吗?有人遇到过类似的问题吗?

Is there any way Guvnor can be tuned to support UTF-8 in this case? Had anyone faced similar issue?

谢谢

@Geoffrey De Smet

@Geoffrey De Smet

我已将以下代码添加到ExcelParser.java:

I have added following code to ExcelParser.java:

WorkbookSettings ws = new WorkbookSettings();
        ws.setEncoding("UTF-8");
        Workbook workbook = Workbook.getWorkbook( inStream , ws);

我已经从git-hub成功构建了drools项目,但是当我尝试构建guvnor-webapp进行测试时这,无论是使用Maven 2.2.1还是使用Maven 3.0.3,我都会遇到相同的错误:

I have successfully built drools project from git-hub, but when I try building guvnor-webapp to test this, either with maven 2.2.1 or maven 3.0.3, I get the same error:

在此方面的任何帮助将不胜感激!

Any help on this would be appreciated!

谢谢!

PS我已阅读,并按说明进行操作。

P.S. I have read README document, and proceeded as described.

推荐答案

仍然是开放的,并且不容易修复,因为excel文件的编码因地区而异。

The issue is still open and not easy to fix because excel file encoding differs from locale to locale.

一种已知的解决方法(由Amer Zec建议)是在上面启动应用服务器Guvnor使用 -Djxl.encoding = cp1252 运行(如果您是西欧人,则使用 cp1252 以外的其他编码)。

One known workaround (suggested by Amer Zec) is to start the app server on which Guvnor runs with -Djxl.encoding=cp1252 (if you're West-European, otherwise use another encoding than cp1252).

这篇关于Guvnor规则编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 05:51