You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/08/09 16:07:02 UTC

[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull request #263: Add more obscure charsets needed for some mil formats.

mbeckerle commented on a change in pull request #263: Add more obscure charsets needed for some mil formats.
URL: https://github.com/apache/incubator-daffodil/pull/263#discussion_r312548813
 
 

 ##########
 File path: daffodil-io/src/main/scala/org/apache/daffodil/processors/charset/X_DFDL_MIL_STD.scala
 ##########
 @@ -48,6 +48,46 @@ object BitsCharset6BitDFI311DUI002 extends {
   override val requiredBitOrder = BitOrder.LeastSignificantBitFirst
 } with BitsCharsetNonByteSize
 
+object BitsCharset3BitDFI336DUI001 extends {
+  override val name = "X-DFDL-3-BIT-DFI-336-DUI-001"
+  override val bitWidthOfACodeUnit = 3
+  override val decodeString = """12345678"""
+  override val replacementCharCode = 0x0
+  override val requiredBitOrder = BitOrder.LeastSignificantBitFirst
+} with BitsCharsetNonByteSize
+
+object BitsCharset4BitDFI746DUI002 extends {
+  override val name = "X-DFDL-4-BIT-DFI-746-DUI-002"
+  override val bitWidthOfACodeUnit = 4
+  override val decodeString = """ABCDEFGHIJKLMNPQ"""
+  override val replacementCharCode = 0x0
+  override val requiredBitOrder = BitOrder.LeastSignificantBitFirst
+} with BitsCharsetNonByteSize
+
+object BitsCharset3BitDFI746DUI002 extends {
+  override val name = "X-DFDL-3-BIT-DFI-746-DUI-002"
+  override val bitWidthOfACodeUnit = 3
+  override val decodeString = """ABCDEFGH"""
+  override val replacementCharCode = 0x0
+  override val requiredBitOrder = BitOrder.LeastSignificantBitFirst
+} with BitsCharsetNonByteSize
+
+object BitsCharset3BitDFI747DUI001 extends {
+  override val name = "X-DFDL-3-BIT-DFI-747-DUI-001"
 
 Review comment:
   The notion here is that we pick one of the dfi/dui as the "canonical" usage, and any other dfi/dui that share the encoding would use that same encoding, and the fact that it is shared would not look like a mistake, as much as intention to share the "canonical" one. Lots of things are shared across dfi/duis so this seems an ok course.  Or we could do aliases as you suggest. There are numerous specs that could be re-using these encodings, but all of them are these DFI/DUI-style specs, so I think there is little gained by avoiding the DFI/DUI identification. 
   
   There is an argument to get the dfi/dui notation entirely out of Daffodil, but in doing so we just make it hard for anyone using Daffodil to know if the charset they need is in fact part of daffodil, so we'd end up documenting them as X-DFDL-TDL-NNNN-M is the charset needed for DFI X DUI Y anyway. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services