mbeckerle commented on a change in pull request #254: Adds hex/utf-8 data dump 
on left over data
URL: https://github.com/apache/incubator-daffodil/pull/254#discussion_r298586220
 
 

 ##########
 File path: daffodil-io/src/main/scala/org/apache/daffodil/io/Dump.scala
 ##########
 @@ -598,13 +599,13 @@ class DataDumper {
 
     val endByteAddress0b = math.max(startByteAddress0b + lengthInBytes - 1, 0)
     // val cs = optEncodingName.map { Charset.forName(_) }
-    val decoder = getReplacingDecoder(optEncodingName)
+    val decoder = getReportingDecoder(optEncodingName)
     var i = startByteAddress0b
     val sb = new StringBuilder
     while (i <= endByteAddress0b) {
-      val (cR, _, _) = convertToCharRepr(i - startByteAddress0b, 
endByteAddress0b, byteSource, decoder)
-      sb += cR(0)
-      i += 1
+      val (cR, nBytesConsumed, _) = convertToCharRepr(i - startByteAddress0b, 
endByteAddress0b, byteSource, decoder)
 
 Review comment:
   I don't know if we should be trying to enhance this to produce a useful 
textual dump along side the byte dump for non-8-bit characters. Making that 
meaningful in any way is hard. I think one would have to do a binary 
(individual bits) dump, instead of hex to do that. Let's not do that. I think 
it is overkill.  Or rather, let's not do that as part of fixing THIS jira 
ticket, which is just about the left-over-data dump.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to