stevedlawrence 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_r298570796
 
 

 ##########
 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:
   getReplacingDecoder returns a JavaCharsetDecoder, so it can only decode full 
byte characters. I believe there's a bug to update the text dumper to support 
non-byte size charsets.

----------------------------------------------------------------
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