[
https://issues.apache.org/jira/browse/DAFFODIL-2612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17763781#comment-17763781
]
Steve Lawrence commented on DAFFODIL-2612:
------------------------------------------
Yep, I've confirmed that newer versions of sbt set {{-Dfile.encoding=UTF-8}} if
the JAVA_OPTS variable is not defined. So even if LANG is defined, if JAVA_OPTS
isn't then the encoding part is ignored and UTF-8 is used. So that is why I was
unable to reproduce it on newer versions of sbt.
So to reproduce the errors in this bug regardless of SBT version, run the
following:
{code:bash}
LANG=en_US.US-ASCII JAVA_OPTS=-Dfile.encoding=US-ASCII sbt daffodil-cli/test
{code}
Due to changes in the CLI test infrastructure, this causes the mentioned tests
to hang instead of fail.
We could try to fix the tests so that can still work with non-UTF-8 encodings,
but I'm not sure that's worth the effort.
Maybe a better approach is to just modify the .sbtopts file in the root of our
repo to include:
{code}
-J-Dfile.encoding=UTF-8
{code}
This way no matter what encoding a users environment uses, our tests will run
with a UTF-8 encoding and won't run into this issue.
One potential concern is this might make it hard to detect errors were Daffodil
does not specify an encoding and just uses the file.encoding property. It
likely shouldn't ever be doing that, so being able to set file.encoding to
something else might be a good way to catch errors.
Or maybe there is an actual bug here, and our debugger isn't correctly
specifying the encoding to use when it creates a PrintStream...
> Integration tests fail with non UTF-8 LANG
> ------------------------------------------
>
> Key: DAFFODIL-2612
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2612
> Project: Daffodil
> Issue Type: Bug
> Components: CLI, Debugger
> Affects Versions: 3.2.1
> Reporter: Steve Lawrence
> Assignee: Steve Lawrence
> Priority: Minor
> Fix For: 3.5.1
>
>
> The CLI debugger sometimes outputs non-ascii characters when outputting a hex
> dump. Two integration tests checks for these non-ascii characters:
> *
> org.apache.daffodil.debugger.TestCLIdebugger.test_3258_CLI_Debugger_infodata
> *
> org.apache.daffodil.debugger.TestCLIdebugger.test_CLI_Debugger_utf16_encoding
> With LANG set to an ASCII encoding, those non-ascii characters are output as
> question marks, and the integration tests fail. To reproduce, run the
> following
> {code:java}
> $ export LANG=en_US.US-ASCII
> $ sbt IntegrationTest/test{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)