You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "baldimir (via GitHub)" <gi...@apache.org> on 2023/12/11 14:34:01 UTC
[PR] [kie-issues#754] Use UTF-8 on important places during Quarkus build [incubator-kie-drools]
baldimir opened a new pull request, #5620:
URL: https://github.com/apache/incubator-kie-drools/pull/5620
Fixes https://github.com/apache/incubator-kie-issues/issues/754
[TODO] There will be a Kogito PR, that is requried too, here in next few minutes.
Uses UTF-8 on important places during the Quarkus build. I suggest we should do a broader encoding review during next year. There are more places, like e.g. calling String.getBytes() without encoding and similar on many places. Unfortunately this is very hard to test, as the behaviour I was fixing only happens on an environment that doesn't use UTF-8, so there are no new test cases added. If you know about some option how to add such tests, please let me know and I will add them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kie-issues#754] Use UTF-8 on important places during Quarkus build [incubator-kie-drools]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #5620:
URL: https://github.com/apache/incubator-kie-drools/pull/5620#discussion_r1422625198
##########
kie-memory-compiler/src/main/java/org/kie/memorycompiler/jdknative/NativeJavaCompiler.java:
##########
@@ -87,7 +87,7 @@ public CompilationResult compile( String[] pResourcePaths,
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
JavaCompiler compiler = getJavaCompiler();
- try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, null)) {
+ try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, Charset.forName(pSettings.getSourceEncoding()))) {
Review Comment:
hi @baldimir : why here it is not used the hardcoded "UTF_8" charset ? Could there be any issue when this encoding it is not UTF_8 ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kie-issues#754] Use UTF-8 on important places during Quarkus build [incubator-kie-drools]
Posted by "baldimir (via GitHub)" <gi...@apache.org>.
baldimir commented on code in PR #5620:
URL: https://github.com/apache/incubator-kie-drools/pull/5620#discussion_r1423603836
##########
kie-memory-compiler/src/main/java/org/kie/memorycompiler/jdknative/NativeJavaCompiler.java:
##########
@@ -87,7 +87,7 @@ public CompilationResult compile( String[] pResourcePaths,
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
JavaCompiler compiler = getJavaCompiler();
- try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, null)) {
+ try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, Charset.forName(pSettings.getSourceEncoding()))) {
Review Comment:
UTF-8 is used by default in the configuration, so I wanted to promote its use as it is used also elsewhere. I plan a larger review of encoding next year, I would say we could solve this problem in a more global better way then (maybe having some drools.encoding property or similar). What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kie-issues#754] Use UTF-8 on important places during Quarkus build [incubator-kie-drools]
Posted by "baldimir (via GitHub)" <gi...@apache.org>.
baldimir commented on code in PR #5620:
URL: https://github.com/apache/incubator-kie-drools/pull/5620#discussion_r1423706272
##########
kie-memory-compiler/src/main/java/org/kie/memorycompiler/jdknative/NativeJavaCompiler.java:
##########
@@ -87,7 +87,7 @@ public CompilationResult compile( String[] pResourcePaths,
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
JavaCompiler compiler = getJavaCompiler();
- try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, null)) {
+ try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, Charset.forName(pSettings.getSourceEncoding()))) {
Review Comment:
There are some tests, as far as I know, that use a resource in different encoding. However this fix is for a case where the environment is in different encoding. That is why I was not able to add any new test case unfortunately. If someone knows how we could simulate that reliably, please let me know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kie-issues#754] Use UTF-8 on important places during Quarkus build [incubator-kie-drools]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio commented on code in PR #5620:
URL: https://github.com/apache/incubator-kie-drools/pull/5620#discussion_r1423660112
##########
kie-memory-compiler/src/main/java/org/kie/memorycompiler/jdknative/NativeJavaCompiler.java:
##########
@@ -87,7 +87,7 @@ public CompilationResult compile( String[] pResourcePaths,
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
JavaCompiler compiler = getJavaCompiler();
- try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, null)) {
+ try (StandardJavaFileManager jFileManager = compiler.getStandardFileManager(diagnostics, null, Charset.forName(pSettings.getSourceEncoding()))) {
Review Comment:
Fine for me!
Side note: is there any test/pr check with different encoding ? If not, I think, in the future, we should try to also have this kind of checkl
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [kie-issues#754] Use UTF-8 on important places during Quarkus build [incubator-kie-drools]
Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco merged PR #5620:
URL: https://github.com/apache/incubator-kie-drools/pull/5620
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org