You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by ef...@apache.org on 2018/11/26 23:38:32 UTC

[incubator-daffodil] branch master updated: Updating to set encoding of CLI output to UTF-8

This is an automated email from the ASF dual-hosted git repository.

efinnegan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git


The following commit(s) were added to refs/heads/master by this push:
     new d5826ec  Updating to set encoding of CLI output to UTF-8
d5826ec is described below

commit d5826ec302820a20a8899d8bc3a889b247f15949
Author: Beth Fahl <ef...@tresys.com>
AuthorDate: Fri Nov 16 16:50:21 2018 -0500

    Updating to set encoding of CLI output to UTF-8
    
    Without an encoding specified the system default is used for outputting
    the infoset in the CLI, which could result in unexpected output. This
    will ensure UTF-8 is used instead of the system default.
    
    Daffodil-2011
---
 daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala b/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
index 26b6e66..c2bdaae 100644
--- a/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
+++ b/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
@@ -845,7 +845,7 @@ object Main extends Logging {
               case Some("-") | None => System.out
               case Some(file) => new FileOutputStream(file)
             }
-            val writer = new BufferedWriter(new OutputStreamWriter(output))
+            val writer = new BufferedWriter(new OutputStreamWriter(output, "UTF-8"))
             val outputter = getInfosetOutputter(parseOpts.infosetType.toOption.get, writer)
 
             var lastParseBitPosition = 0L