You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/12/07 14:52:32 UTC

[GitHub] [daffodil] tuxji commented on a change in pull request #696: Ensure we use UTF-8 when outputting and comparing SAX output

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



##########
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:
       For future reference, you can get a sane number of results to check by using [ripgrep](https://lib.rs/crates/ripgrep) with options like `rg -g \*.scala -i --sort=path utf-8` which avoids false positives from all the XML-type files but finds all the occurrences of utf-8 in Scala files.  Now only half of the results look like false positives and the remaining results look like places that should be checked although I'm not sure if some APIs accept Charset instead of 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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org