mbeckerle commented on a change in pull request #696:
URL: https://github.com/apache/daffodil/pull/696#discussion_r763369916



##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DaffodilParseOutputStreamContentHandler.scala
##########
@@ -42,7 +43,7 @@ import org.xml.sax.Locator
  */
 class DaffodilParseOutputStreamContentHandler(out: OutputStream, pretty: 
Boolean = false)
   extends ContentHandler with Indentable {
-  private val writer = new OutputStreamWriter(out)
+  private val writer = new OutputStreamWriter(out, Charset.forName("UTF-8"))

Review comment:
       You know, it would be super nice if there was a way to automate checks 
for things like this, where one could setup a rule named "always specify 
encoding", with a bunch of checks of constructors like this, and methods, 
basically deprecating the flavors that don't specify an encoding. 
   
   Ever heard of such a tool?

##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DaffodilParseOutputStreamContentHandler.scala
##########
@@ -42,7 +43,7 @@ import org.xml.sax.Locator
  */
 class DaffodilParseOutputStreamContentHandler(out: OutputStream, pretty: 
Boolean = false)
   extends ContentHandler with Indentable {
-  private val writer = new OutputStreamWriter(out)
+  private val writer = new OutputStreamWriter(out, Charset.forName("UTF-8"))

Review comment:
       StandardCharsets.UTF_8 Is a constant. I think stylistically preferable 
to calling forName with a string. 




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to