[jboss-jira] [JBoss JIRA] (JBRULES-3341) Specify .drl file encoding when creating resource
Geoffrey De Smet (JIRA)
jira-events at lists.jboss.org
Thu Mar 29 08:44:47 EDT 2012
[ https://issues.jboss.org/browse/JBRULES-3341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680249#comment-12680249 ]
Geoffrey De Smet edited comment on JBRULES-3341 at 3/29/12 8:43 AM:
--------------------------------------------------------------------
Note that you can do:
{code}
ResourceFactory.newReaderResource(new InputStreamReader(in, "UTF-8"))
{code}
Note: looks like the DRLParser just ignores that. I 've fixed that too in my pull request.
https://github.com/droolsjbpm/drools/pull/111
was (Author: ge0ffrey):
Note that you can do:
{code}
ResourceFactory.newReaderResource(new InputStreamReader(in, "UTF-8"))
{code}
Note: looks like the DRLParser just ignores that. I 've fixed that too in my pull request.
> Specify .drl file encoding when creating resource
> -------------------------------------------------
>
> Key: JBRULES-3341
> URL: https://issues.jboss.org/browse/JBRULES-3341
> Project: Drools
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: drools-compiler (expert)
> Affects Versions: 5.3.0.Final
> Environment: drools 5.3.0 final, ubuntu linux 11.04, amd64, sun jdk 1.6u27
> Reporter: Miles Wen
> Assignee: Geoffrey De Smet
> Labels: drl, encoding
> Fix For: 5.4.0.CR1
>
>
> Would you please provide a method in 'org.drools.io.ResourceFactory' like this:
> public static Resource newReaderResource(InputStream stream, String encoding);
> then I can use this method to load drl files as a stream while explicitly specify its ecoding?
> And in line: 287 of class 'org.drools.compiler.DrlParser':
> lexer = new DRLLexer( new ANTLRInputStream( is ) );
> no encoding specified as well. The ANTLRInputStream has constructors which allows you to specify the encoding, otherwise it would figure out the encoding according to the environment, which is unpredictable some times.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list