stevedlawrence commented on code in PR #1149:
URL: https://github.com/apache/daffodil/pull/1149#discussion_r1458995190


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -700,6 +701,30 @@ trait ElementBaseGrammarMixin
       ConvertZonedCombinator(this, stringValue, textZonedConverter)
     }
 
+  /**
+   * True if the encoding is known to be an EBCDIC one, as in the encoding is 
not  a runtime expression
+   * and it's some ebcdic flavor. If it's any ascii flavor or a runtime 
expression this is false.
+   */
+  lazy val isKnownEBCDICEncoding: Boolean = {
+    charsetEv.optConstant
+      .map { bcs: BitsCharset =>
+        val nom = bcs.name.toUpperCase()
+        val res = (nom == "IBM037") ||
+          nom.startsWith("EBCDIC")
+        res
+      }
+      .getOrElse(false)
+  }
+
+  /**
+   * Avoids requesting the textZonedSignStyle property if we know the encoding
+   * is an EBCDIC flavor.
+   */
+  lazy val optTextZonedSignStyle = {
+    if (isKnownEBCDICEncoding) None
+    else Some(textZonedSignStyle)
+  }

Review Comment:
   This doesn't do the right thing if the charset is non-constant be evaluates 
to EBCIDC at runtime. Is that something we care about? Does it make sense to 
convert this to a evaluatable?



##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -700,6 +701,30 @@ trait ElementBaseGrammarMixin
       ConvertZonedCombinator(this, stringValue, textZonedConverter)
     }
 
+  /**
+   * True if the encoding is known to be an EBCDIC one, as in the encoding is 
not  a runtime expression
+   * and it's some ebcdic flavor. If it's any ascii flavor or a runtime 
expression this is false.
+   */
+  lazy val isKnownEBCDICEncoding: Boolean = {
+    charsetEv.optConstant
+      .map { bcs: BitsCharset =>
+        val nom = bcs.name.toUpperCase()
+        val res = (nom == "IBM037") ||
+          nom.startsWith("EBCDIC")

Review Comment:
   Should we add an `isEBCDIC` member to `BitsCharset` that defaults to 
`false`, and any EBCDIC encodings we implement would override that to `true`? 
Then this just becomes
   
   ```scala
   charsetEv.optConstant.map { _.isEBCDIC }.getOrElse(false)
   ```
   
   Also, doing some grepping for EBCDIC I see we also have a 
`Misc.isAsciiBased` function. That's only used for dumping debug data and works 
on Java charsets instead of our BitsCharset, but maybe it provides extra 
motivation that we might eventually want to have other `is*` members so we can 
ask questions about our supported charsets without having to make guesses based 
on the name.



##########
daffodil-lib/src/test/scala/org/apache/daffodil/lib/util/TestDecimalUtils.scala:
##########
@@ -1846,733 +1989,1620 @@ class TestDecimalUtils {
 
   @Test def zonedIntAsciiStandardAllDigits(): Unit = {
     assertEquals(
-      zonedToNumber("0", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("0", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "0",
     )
     assertEquals(
-      zonedFromNumber("0", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("0", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "0",
     )
     assertEquals(
-      zonedToNumber("1", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("1", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "1",
     )
     assertEquals(
-      zonedFromNumber("1", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("1", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "1",
     )
     assertEquals(
-      zonedToNumber("2", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("2", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "2",
     )
     assertEquals(
-      zonedFromNumber("2", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("2", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "2",
     )
     assertEquals(
-      zonedToNumber("3", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("3", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "3",
     )
     assertEquals(
-      zonedFromNumber("3", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("3", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "3",
     )
     assertEquals(
-      zonedToNumber("4", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("4", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "4",
     )
     assertEquals(
-      zonedFromNumber("4", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("4", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "4",
     )
     assertEquals(
-      zonedToNumber("5", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("5", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "5",
     )
     assertEquals(
-      zonedFromNumber("5", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("5", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "5",
     )
     assertEquals(
-      zonedToNumber("6", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("6", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "6",
     )
     assertEquals(
-      zonedFromNumber("6", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("6", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "6",
     )
     assertEquals(
-      zonedToNumber("7", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("7", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "7",
     )
     assertEquals(
-      zonedFromNumber("7", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("7", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "7",
     )
     assertEquals(
-      zonedToNumber("8", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("8", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "8",
     )
     assertEquals(
-      zonedFromNumber("8", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("8", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "8",
     )
     assertEquals(
-      zonedToNumber("9", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("9", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "9",
     )
     assertEquals(
-      zonedFromNumber("9", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("9", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "9",
     )
     assertEquals(
-      zonedToNumber("1p", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.End),
+      zonedToNumber("1p", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.End),
       "-10",
     )
     assertEquals(
-      zonedFromNumber("-10", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.End),
+      zonedFromNumber("-10", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.End),
       "1p",
     )
     assertEquals(
-      zonedToNumber("q", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("q", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-1",
     )
     assertEquals(
-      zonedFromNumber("-1", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-1", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "q",
     )
     assertEquals(
-      zonedToNumber("r", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("r", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-2",
     )
     assertEquals(
-      zonedFromNumber("-2", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-2", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "r",
     )
     assertEquals(
-      zonedToNumber("s", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("s", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-3",
     )
     assertEquals(
-      zonedFromNumber("-3", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-3", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "s",
     )
     assertEquals(
-      zonedToNumber("t", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("t", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-4",
     )
     assertEquals(
-      zonedFromNumber("-4", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-4", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "t",
     )
     assertEquals(
-      zonedToNumber("u", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("u", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-5",
     )
     assertEquals(
-      zonedFromNumber("-5", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-5", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "u",
     )
     assertEquals(
-      zonedToNumber("v", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("v", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-6",
     )
     assertEquals(
-      zonedFromNumber("-6", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-6", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "v",
     )
     assertEquals(
-      zonedToNumber("w", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("w", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-7",
     )
     assertEquals(
-      zonedFromNumber("-7", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-7", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "w",
     )
     assertEquals(
-      zonedToNumber("x", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("x", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-8",
     )
     assertEquals(
-      zonedFromNumber("-8", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-8", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "x",
     )
     assertEquals(
-      zonedToNumber("y", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedToNumber("y", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "-9",
     )
     assertEquals(
-      zonedFromNumber("-9", TextZonedSignStyle.AsciiStandard, 
OverpunchLocation.Start),
+      zonedFromNumber("-9", Some(TextZonedSignStyle.AsciiStandard), 
OverpunchLocation.Start),
       "y",
     )
   }
 
   @Test def zonedIntAsciiTranslatedEBCDICAllDigits(): Unit = {
     assertEquals(
-      zonedToNumber("0", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "0",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "0",
     )
     assertEquals(
-      zonedFromNumber("0", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "0",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "0",
     )
     assertEquals(
-      zonedToNumber("1", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "1",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "1",
     )
     assertEquals(
-      zonedFromNumber("1", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "1",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "1",
     )
     assertEquals(
-      zonedToNumber("2", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "2",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "2",
     )
     assertEquals(
-      zonedFromNumber("2", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "2",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "2",
     )
     assertEquals(
-      zonedToNumber("3", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "3",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "3",
     )
     assertEquals(
-      zonedFromNumber("3", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "3",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "3",
     )
     assertEquals(
-      zonedToNumber("4", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "4",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "4",
     )
     assertEquals(
-      zonedFromNumber("4", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "4",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "4",
     )
     assertEquals(
-      zonedToNumber("5", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "5",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "5",
     )
     assertEquals(
-      zonedFromNumber("5", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "5",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "5",
     )
     assertEquals(
-      zonedToNumber("6", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "6",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "6",
     )
     assertEquals(
-      zonedFromNumber("6", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "6",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "6",
     )
     assertEquals(
-      zonedToNumber("7", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "7",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "7",
     )
     assertEquals(
-      zonedFromNumber("7", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "7",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "7",
     )
     assertEquals(
-      zonedToNumber("8", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "8",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "8",
     )
     assertEquals(
-      zonedFromNumber("8", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "8",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "8",
     )
     assertEquals(
-      zonedToNumber("9", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedToNumber(
+        "9",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "9",
     )
     assertEquals(
-      zonedFromNumber("9", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.None),
+      zonedFromNumber(
+        "9",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.None,
+      ),
       "9",
     )
     assertEquals(
-      zonedToNumber("{", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "{",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "0",
     )
     assertEquals(
-      zonedFromNumber("0", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "0",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "{",
     )
     assertEquals(
-      zonedToNumber("A", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "A",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "1",
     )
     assertEquals(
-      zonedFromNumber("1", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "1",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "A",
     )
     assertEquals(
-      zonedToNumber("B", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "B",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "2",
     )
     assertEquals(
-      zonedFromNumber("2", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "2",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "B",
     )
     assertEquals(
-      zonedToNumber("C", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "C",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "3",
     )
     assertEquals(
-      zonedFromNumber("3", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "3",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "C",
     )
     assertEquals(
-      zonedToNumber("D", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "D",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "4",
     )
     assertEquals(
-      zonedFromNumber("4", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "4",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "D",
     )
     assertEquals(
-      zonedToNumber("E", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "E",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "5",
     )
     assertEquals(
-      zonedFromNumber("5", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "5",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "E",
     )
     assertEquals(
-      zonedToNumber("F", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "F",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "6",
     )
     assertEquals(
-      zonedFromNumber("6", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "6",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "F",
     )
     assertEquals(
-      zonedToNumber("G", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "G",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "7",
     )
     assertEquals(
-      zonedFromNumber("7", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "7",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "G",
     )
     assertEquals(
-      zonedToNumber("H", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "H",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "8",
     )
     assertEquals(
-      zonedFromNumber("8", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "8",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "H",
     )
     assertEquals(
-      zonedToNumber("I", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "I",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "9",
     )
     assertEquals(
-      zonedFromNumber("9", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "9",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "I",
     )
     assertEquals(
-      zonedToNumber("1}", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.End),
+      zonedToNumber(
+        "1}",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.End,
+      ),
       "-10",
     )
     assertEquals(
-      zonedFromNumber("-10", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.End),
+      zonedFromNumber(
+        "-10",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.End,
+      ),
       "1}",
     )
     assertEquals(
-      zonedToNumber("J", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "J",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-1",
     )
     assertEquals(
-      zonedFromNumber("-1", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-1",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "J",
     )
     assertEquals(
-      zonedToNumber("K", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "K",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-2",
     )
     assertEquals(
-      zonedFromNumber("-2", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-2",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "K",
     )
     assertEquals(
-      zonedToNumber("L", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "L",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-3",
     )
     assertEquals(
-      zonedFromNumber("-3", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-3",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "L",
     )
     assertEquals(
-      zonedToNumber("M", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "M",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-4",
     )
     assertEquals(
-      zonedFromNumber("-4", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-4",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "M",
     )
     assertEquals(
-      zonedToNumber("N", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "N",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-5",
     )
     assertEquals(
-      zonedFromNumber("-5", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-5",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "N",
     )
     assertEquals(
-      zonedToNumber("O", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "O",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-6",
     )
     assertEquals(
-      zonedFromNumber("-6", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-6",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "O",
     )
     assertEquals(
-      zonedToNumber("P", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "P",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-7",
     )
     assertEquals(
-      zonedFromNumber("-7", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-7",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "P",
     )
     assertEquals(
-      zonedToNumber("Q", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "Q",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-8",
     )
     assertEquals(
-      zonedFromNumber("-8", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-8",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "Q",
     )
     assertEquals(
-      zonedToNumber("R", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "R",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "-9",
     )
     assertEquals(
-      zonedFromNumber("-9", TextZonedSignStyle.AsciiTranslatedEBCDIC, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-9",
+        Some(TextZonedSignStyle.AsciiTranslatedEBCDIC),
+        OverpunchLocation.Start,
+      ),
       "R",
     )
   }
 
   @Test def zonedIntAsciiCARealiaModifiedAllDigits(): Unit = {
     assertEquals(
-      zonedToNumber("0", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "0",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "0",
     )
     assertEquals(
-      zonedFromNumber("0", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "0",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "0",
     )
     assertEquals(
-      zonedToNumber("1", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "1",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "1",
     )
     assertEquals(
-      zonedFromNumber("1", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "1",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "1",
     )
     assertEquals(
-      zonedToNumber("2", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "2",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "2",
     )
     assertEquals(
-      zonedFromNumber("2", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "2",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "2",
     )
     assertEquals(
-      zonedToNumber("3", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "3",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "3",
     )
     assertEquals(
-      zonedFromNumber("3", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "3",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "3",
     )
     assertEquals(
-      zonedToNumber("4", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "4",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "4",
     )
     assertEquals(
-      zonedFromNumber("4", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "4",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "4",
     )
     assertEquals(
-      zonedToNumber("5", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "5",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "5",
     )
     assertEquals(
-      zonedFromNumber("5", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "5",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "5",
     )
     assertEquals(
-      zonedToNumber("6", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "6",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "6",
     )
     assertEquals(
-      zonedFromNumber("6", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "6",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "6",
     )
     assertEquals(
-      zonedToNumber("7", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "7",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "7",
     )
     assertEquals(
-      zonedFromNumber("7", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "7",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "7",
     )
     assertEquals(
-      zonedToNumber("8", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "8",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "8",
     )
     assertEquals(
-      zonedFromNumber("8", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "8",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "8",
     )
     assertEquals(
-      zonedToNumber("9", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "9",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "9",
     )
     assertEquals(
-      zonedFromNumber("9", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "9",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "9",
     )
     assertEquals(
-      zonedToNumber("1 ", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.End),
+      zonedToNumber(
+        "1 ",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.End,
+      ),
       "-10",
     )
     assertEquals(
-      zonedFromNumber("-10", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.End),
+      zonedFromNumber(
+        "-10",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.End,
+      ),
       "1 ",
     )
     assertEquals(
-      zonedToNumber("!", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "!",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-1",
     )
     assertEquals(
-      zonedFromNumber("-1", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-1",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "!",
     )
     assertEquals(
-      zonedToNumber("\"", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "\"",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-2",
     )
     assertEquals(
-      zonedFromNumber("-2", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-2",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "\"",
     )
     assertEquals(
-      zonedToNumber("#", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "#",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-3",
     )
     assertEquals(
-      zonedFromNumber("-3", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-3",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "#",
     )
     assertEquals(
-      zonedToNumber("$", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "$",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-4",
     )
     assertEquals(
-      zonedFromNumber("-4", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-4",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "$",
     )
     assertEquals(
-      zonedToNumber("%", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "%",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-5",
     )
     assertEquals(
-      zonedFromNumber("-5", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-5",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "%",
     )
     assertEquals(
-      zonedToNumber("&", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "&",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-6",
     )
     assertEquals(
-      zonedFromNumber("-6", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-6",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "&",
     )
     assertEquals(
-      zonedToNumber("'", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "'",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-7",
     )
     assertEquals(
-      zonedFromNumber("-7", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-7",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "'",
     )
     assertEquals(
-      zonedToNumber("(", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        "(",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-8",
     )
     assertEquals(
-      zonedFromNumber("-8", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-8",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "(",
     )
     assertEquals(
-      zonedToNumber(")", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedToNumber(
+        ")",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       "-9",
     )
     assertEquals(
-      zonedFromNumber("-9", TextZonedSignStyle.AsciiCARealiaModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-9",
+        Some(TextZonedSignStyle.AsciiCARealiaModified),
+        OverpunchLocation.Start,
+      ),
       ")",
     )
   }
 
   @Test def zonedIntAsciiTandemModifiedAllDigits(): Unit = {
     assertEquals(
-      zonedToNumber("0", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("0", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "0",
     )
     assertEquals(
-      zonedFromNumber("0", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "0",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "0",
     )
     assertEquals(
-      zonedToNumber("1", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("1", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "1",
     )
     assertEquals(
-      zonedFromNumber("1", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "1",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "1",
     )
     assertEquals(
-      zonedToNumber("2", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("2", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "2",
     )
     assertEquals(
-      zonedFromNumber("2", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "2",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "2",
     )
     assertEquals(
-      zonedToNumber("3", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("3", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "3",
     )
     assertEquals(
-      zonedFromNumber("3", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "3",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "3",
     )
     assertEquals(
-      zonedToNumber("4", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("4", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "4",
     )
     assertEquals(
-      zonedFromNumber("4", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "4",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "4",
     )
     assertEquals(
-      zonedToNumber("5", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("5", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "5",
     )
     assertEquals(
-      zonedFromNumber("5", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "5",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "5",
     )
     assertEquals(
-      zonedToNumber("6", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("6", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "6",
     )
     assertEquals(
-      zonedFromNumber("6", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "6",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "6",
     )
     assertEquals(
-      zonedToNumber("7", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("7", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "7",
     )
     assertEquals(
-      zonedFromNumber("7", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "7",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "7",
     )
     assertEquals(
-      zonedToNumber("8", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("8", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "8",
     )
     assertEquals(
-      zonedFromNumber("8", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "8",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "8",
     )
     assertEquals(
-      zonedToNumber("9", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("9", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "9",
     )
     assertEquals(
-      zonedFromNumber("9", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "9",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "9",
     )
     assertEquals(
-      zonedToNumber("1€", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.End),
+      zonedToNumber("1€", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.End),
       "-10",
     )
     assertEquals(
-      zonedFromNumber("-10", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.End),
+      zonedFromNumber(
+        "-10",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.End,
+      ),
       "1€",
     )
     assertEquals(
-      zonedToNumber("", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-1",
     )
     assertEquals(
-      zonedFromNumber("-1", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-1",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "",
     )
     assertEquals(
-      zonedToNumber("‚", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("‚", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-2",
     )
     assertEquals(
-      zonedFromNumber("-2", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-2",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "‚",
     )
     assertEquals(
-      zonedToNumber("ƒ", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("ƒ", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-3",
     )
     assertEquals(
-      zonedFromNumber("-3", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-3",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "ƒ",
     )
     assertEquals(
-      zonedToNumber("„", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("„", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-4",
     )
     assertEquals(
-      zonedFromNumber("-4", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-4",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "„",
     )
     assertEquals(
-      zonedToNumber("…", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("…", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-5",
     )
     assertEquals(
-      zonedFromNumber("-5", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-5",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "…",
     )
     assertEquals(
-      zonedToNumber("†", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("†", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-6",
     )
     assertEquals(
-      zonedFromNumber("-6", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-6",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "†",
     )
     assertEquals(
-      zonedToNumber("‡", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("‡", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-7",
     )
     assertEquals(
-      zonedFromNumber("-7", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-7",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "‡",
     )
     assertEquals(
-      zonedToNumber("ˆ", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("ˆ", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-8",
     )
     assertEquals(
-      zonedFromNumber("-8", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-8",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "ˆ",
     )
     assertEquals(
-      zonedToNumber("‰", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedToNumber("‰", Some(TextZonedSignStyle.AsciiTandemModified), 
OverpunchLocation.Start),
       "-9",
     )
     assertEquals(
-      zonedFromNumber("-9", TextZonedSignStyle.AsciiTandemModified, 
OverpunchLocation.Start),
+      zonedFromNumber(
+        "-9",
+        Some(TextZonedSignStyle.AsciiTandemModified),
+        OverpunchLocation.Start,
+      ),
       "‰",
     )
   }
+

Review Comment:
   Same question as above, should the positives be `{` and `A-I` instead of 
`0-9`? And do we need tests for the other range of positive/negative values?



##########
daffodil-lib/src/main/scala/org/apache/daffodil/lib/util/DecimalUtils.scala:
##########
@@ -417,6 +436,25 @@ object DecimalUtils {
       throw new NumberFormatException("Invalid zoned digit: " + digit)
   }
 
+  /**
+   * Does not encode to the EBCDIC charset, but converts negative digits
+   * to their EBCDIC Zoned overpunched representation where negative 0 to 9
+   * are mapped to "}JKLMNOPQR".
+   * @param digit - the digit, as a char '0' to '9'
+   * @param positive - true if positive, false if negative
+   * @return the character needed to represent this character as an 
overpunched sign digit.

Review Comment:
   From the spec:
   
   > In EBCDIC-based encodings, code points 0xC0 to 0xC9 or 0xF0 to 0xF9 
represent a positive sign and digits 0 to 9 (these byte ranges correspond 
typically to characters '{ABCDEFGHI' or '0123456789'), and code points 0xD0 to 
0xD9 or 0xB0 to 0xB9 represent a negative sign and digits 0 to 9 (these byte 
ranges correspond typically to characters '}JKLMNOPQR' or  '^£¥·©§¶¼½¾ ' ). On 
parsing both ranges are accepted. On unparsing the range 0xC0 to 0xC9 are 
produced for positive signs and the range 0xD0 to 0xD9 are produced for 
negative signs.
   
   This makes it sound like on unparsing the positive 0-9 digits should be 
unparsed as `{ABCDFGHI` instead of 0-9?



##########
daffodil-lib/src/main/scala/org/apache/daffodil/lib/util/DecimalUtils.scala:
##########
@@ -386,6 +386,25 @@ object DecimalUtils {
     outArray
   }
 
+  /**
+   * Despite the name, this does not actually convert the digit from EBCDIC 
encoding.
+   * The characters have already been decoded from whatever charset into 
Unicode code points.
+   * What this does is deal with overpunched negative sign character mappings.
+   * In this case "}JKLMNOPQR" are negative 0 to 9.
+   * @param digit
+   * @return A pair of the integer the digit represents, and a boolean 
indicating if negative.
+   */
+  def convertFromZonedEBCDIC(digit: Char): (Int, Boolean) = {
+    if ((digit >= '0') && (digit <= '9')) // positive 0-9
+      (digit - 48, false)
+    else if (digit == '}') // negative 0
+      (0, true)
+    else if ((digit >= 'J') && (digit <= 'R')) // negative 1-9
+      (digit - 'J' + 1, true)
+    else
+      throw new NumberFormatException("Invalid zoned digit: " + digit)

Review Comment:
   The DFDL spec says this about `textNumberRep`:
   > In EBCDIC-based encodings, code points 0xC0 to 0xC9 or 0xF0 to 0xF9 
represent a positive sign and digits 0 to 9 (these byte ranges correspond 
typically to characters '{ABCDEFGHI'* or '0123456789'), and code points 0xD0 to 
0xD9 or 0xB0 to 0xB9 represent a negative sign and digits 0 to 9 (these byte 
ranges correspond typically to characters '}JKLMNOPQR' or  '^£¥·©§¶¼½¾ ' ). On 
parsing both ranges are accepted. On unparsing the range 0xC0 to 0xC9 are 
produced for positive signs and the range 0xD0 to 0xD9 are produced for 
negative signs.
   
   Should this function also support `{ABCDEFGHI` for positive numbers and 
`^£¥·©§¶¼½¾ ` for negatives?
   



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